Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning,...

33
BY: Machine Learning for Geologists – 1.5 Hour Workshop Adrian Martinez Vargas Senior Resource Geologist AME Roundup 18-22 January 2021

Transcript of Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning,...

Page 1: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

BY:

Machine Learning for Geologists – 1.5 Hour Workshop

Adrian Martinez VargasSenior Resource Geologist

AME Roundup

18-22 January 2021

Page 2: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Adrian is both a geologist and a geostatistician, an enthusiast of machine learning, and produces open-source software for geostatistics and mineral resources in Python, Fortran, Cython, C and SQL.

He has worked as a consultant since 2002, covering many commodities, including gold, copper, nickel, chromium, and raw material for the cement industry.

Adrian has considerable experience using multiple indicator kriging for resource estimation of gold deposits with high nugget and domaining issues, with non-linear geostatistics and conditional simulations for resource estimation and model validation.

He has previously worked as an Assistant Professor in Cuba and Ethiopia, teaching geology and geostatistics.

2

About thePresenter

Meet ADRIAN MARTINEZ VARGAS - Senior Resource Geologist.

P.Geo, Ph.D. in Geological Sciences, ISMM Moa. Specialist in Geostatistics (CFSG), Paris Mining School. B.Eng. Geology, ISMM Moa

Page 3: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

How CSA Global advises the minerals industry globally

3

Page 4: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

CSA Global supported by a further 160 ERM offices

Page 5: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Agenda

2Introduction to machine learning, with examples. An overview of machine learning algorithms.

5

Software for machine learning.Demonstration 1: installing the software

1

The machine learning workflow.3

Demonstration 2: Simple rock classifier.4

Demonstration 3: Identifying Circular Structures on DTM.5

Page 6: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Software for machine learning

Page 7: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Software for Machine Learning

7

Python distribution (Anaconda)

Script base / python interface

Scikit-learn TensorFlow

Keras

PyTorch

GUI Graphic User Interface

Orange

Powerful and advanced User friendly

Cloud Computing

Google Collab

Page 8: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Demonstration 1: Installing the Software

Page 9: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Demo 1: Installing the Software

• Install Miniconda 64 bit for Python 3.8

• https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

• Install Orange with conda (run these commands in a terminal/command pront)

conda config --add channels conda-forge

conda install orange3

• Run Orange and install add-ons:

• Execute orange with the command: orange-canvas

• And install Image Analytics add-on

• Next steps for advanced users:

• Install scikit-learn, Tensorflow or/and PyTorch, …

9

Page 10: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction

Page 11: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: What is Machine Learning (ML)?

ML is the process of solving a practical problems by 1) gathering a dataset, and 2) algorithmically building a statistical model based on the dataset. That statistical model is assumed to be used somehow to solve the practical problem. (Burkov2019)

The algorithms/models are supervised, unsupervised, semi-supervised, and reinforcement learning.

The problems that can solve are regression, classification, anomaly detection and dimensionality reduction.

11

Supervised Classification

Unsupervised Classification

Page 12: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Machine Learning Algorithms

12

Neural Networks / Deep learningNaive Bayes

Logistic Regression

Classification Tree

Classification Tree Viewer

Nearest Neighbors

Random Forest Classification

SVM

AdaBoost

Linear Regression

Nearest Neighbors

Stochastic Gradient Descent

SVM Regression

Regression Tree

Random Forest Regression

PCA

Correspondence Analysis

Hierarchical Clustering

k-Means

Manifold Learning

MDS

Supervised Unsupervised

Reinforcement

Unsupervised

Supervised

Dense neural network

Neural networks:• Dense• Convolutional• Recurrent

Page 13: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Machine Learning Algorithms

13

Neural Networks / Deep learning

Reinforcement

Unsupervised

Supervised

Neural networks:• Dense• Convolutional• Recurrent

http://playground.tensorflow.org/

Page 14: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

14

Group Task Tool Example Software

Unsupervised

Clustering Hierarchical Clustering

Exploratory data analysis and drillhole logging

Orange

Non-supervised classification

K-Means

Dimension reduction PCA

Supervised

Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes

Drillhole logging, density regression modelRegression

Image classification / segmentation

Convolutional neural networksDrillhole image logging, target generation

Keras –Tensorflow

PyTorch

Sequence recognition Recurrent neural networksDownhole geophysical data interpretation

Semi-supervisedAnomaly detection and one-class classification

Autoencoders neural networks and one-class SVN

Target generation from GIS data; Feature mapping

Introduction: Uses of Machine Learning

Page 15: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Drillhole Logging with Geophysical Data (Flin Flon)

15

Lithology Probabilities Geophysical data

Page 16: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Drillhole Logging with Long Textual Description

16Lithology Probabilities Input data

PredictionML Workflow

Page 17: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Domain Modeling

17

Page 18: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Robust Regression QAQC Duplicates

18

Outliers are not systematically biased

Random sample consensus (RANSAC)

Page 19: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Image Segmentation, to Detect Pebbles in Televiewer (Tristar Gold -Castelo de Sonhos- Brazil)

19

Estimating probability of pebble occurrence using convolutional neural network (sliding windows)

Page 20: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example – Object detection, Wildlife Cameras

20

Identifies Individuals Identifies groups of animals at different distances and aspects

ERM is collaborating with Microsoft and has developed a machine learning program to detect and identify wildlife from Arctic trail cameras.

Page 21: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Image Segmentation, to Detect Structures on DTM

21

Input: Image/DTMOutput: Mask of

Structure

Can learn shapes and its common scale/size

Page 22: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Image Segmentation, to Detect Pebbles in Televiewer (Tristar Gold -Castelo de Sonhos- Brazil)

22

Image Prediction

Training process

Input

Output

Model

Page 23: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Introduction: Example - Detect Alterations Using Satellite Images

23

Training on known deposit: Taca TacaUsing Aster images as input

Results in a different area:Minera Escondida

Page 24: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

The Machine Learning Workflow

Page 25: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

The Machine Learning Workflow

25

Testing data

Validating data

UserData collection

and EDA

Training data

Model TrainingTestingValidating

Production (New) Data

Data representation

Production

Model

Data representation

Define the

problem

Define the problem

Page 26: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

The Machine Learning Workflow: Drillhole Logging System

26

Training stage

Production stage

Page 27: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Demonstration 2: Simple Rock Classifier

Page 28: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Demo 2: Drillhole Logging System

28

Training stage

Production stage

Page 29: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Demonstration 3: Identifying Circular Structures on DTM

Page 30: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Transfer learning

30

http://playground.tensorflow.org/

Nonlinear features

Page 31: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Image Classification Using Transfer Learning(Good for Prototyping)

31

Extract table with 4096 columns

Transfer learning uses pretrained neural networks

(VGG Convolutional Neural network pretrained on ImageNet {1000 different object categories})

Page 32: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

If you enjoyed today’s workshop and would like to learn more, visit us HERE to REGISTER your interest to attend the CSA Global ‘Introduction to Machine Learning’ 2 Day Workshop.

Continue your machine learning journey…

32

Page 33: Machine Learning for Geologists 1.5 Hour Workshop · 2021. 1. 20. · Classification Deep learning, Support Vector Machine (SVM), Naïve Bayes Drillhole logging, density Regression

Connect with the Presenter

Adrian Martinez Vargas

Senior Resource Geologist

[email protected]