CPSC 340: Machine Learning and Data Mining. Convolutional Neural Networks Fall 2018

Similar documents
CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Midterm Examination CS 534: Computational Photography

CAP 5415 Computer Vision. Marshall Tappen Fall Lecture 1

Convolutional neural networks

Matlab (see Homework 1: Intro to Matlab) Linear Filters (Reading: 7.1, ) Correlation. Convolution. Linear Filtering (warm-up slide) R ij

>>> from numpy import random as r >>> I = r.rand(256,256);

Templates and Image Pyramids

Introduction to Machine Learning

>>> from numpy import random as r >>> I = r.rand(256,256);

Digital Image Processing

CIS581: Computer Vision and Computational Photography Homework: Cameras and Convolution Due: Sept. 14, 2017 at 3:00 pm

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Templates and Image Pyramids

Images and Filters. EE/CSE 576 Linda Shapiro

Convolutional Networks Overview

Practical Image and Video Processing Using MATLAB

Study guide for Graduate Computer Vision

Lecture 3: Linear Filters

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

Last Lecture. photomatix.com

Vision Review: Image Processing. Course web page:

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Robert Collins CSE486, Penn State. Lecture 3: Linear Operators

Coursework 2. MLP Lecture 7 Convolutional Networks 1

Image features: Histograms, Aliasing, Filters, Orientation and HOG. D.A. Forsyth

Motion illusion, rotating snakes

Deconvolution , , Computational Photography Fall 2017, Lecture 17

CS 111: Programing Assignment 2

Biologically Inspired Computation

Prof. Feng Liu. Winter /10/2019

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

6. Convolutional Neural Networks

Midterm is on Thursday!

ELEC Dr Reji Mathew Electrical Engineering UNSW

Lecture 17 Convolutional Neural Networks

CSC321 Lecture 11: Convolutional Networks

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

02/02/10. Image Filtering. Computer Vision CS 543 / ECE 549 University of Illinois. Derek Hoiem

Deep Learning. Dr. Johan Hagelbäck.

EE482: Digital Signal Processing Applications

Understanding Matrices to Perform Basic Image Processing on Digital Images

Perception. Introduction to HRI Simmons & Nourbakhsh Spring 2015

Computer Vision, Lecture 3

Research on Hand Gesture Recognition Using Convolutional Neural Network

Last Lecture. photomatix.com

Creating Intelligence at the Edge

Image Enhancement in spatial domain. Digital Image Processing GW Chapter 3 from Section (pag 110) Part 2: Filtering in spatial domain

Digital Image Processing. Lecture 5 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Chapter 2 Image Enhancement in the Spatial Domain

Convolution Engine: Balancing Efficiency and Flexibility in Specialized Computing

Introduction. Ioannis Rekleitis

Announcements. Image Processing. What s an image? Images as functions. Image processing. What s a digital image?

Motivation: Image denoising. How can we reduce noise in a photograph?

CONVOLUTIONAL NEURAL NETWORKS: MOTIVATION, CONVOLUTION OPERATION, ALEXNET

Overview. Neighborhood Filters. Dithering

Image Deblurring and Noise Reduction in Python TJHSST Senior Research Project Computer Systems Lab

CS6670: Computer Vision Noah Snavely. Administrivia. Administrivia. Reading. Last time: Convolution. Last time: Cross correlation 9/8/2009

Numerical Derivatives See also T&V, Appendix A.2 Gradient = vector of partial derivatives of image I(x,y) = [di(x,y)/dx, di(x,y)/dy]

CSCI 1290: Comp Photo

Image acquisition. Midterm Review. Digitization, line of image. Digitization, whole image. Geometric transformations. Interpolation 10/26/2016

Motivation: Image denoising. How can we reduce noise in a photograph?

Chapter 17. Shape-Based Operations

Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

Classification Accuracies of Malaria Infected Cells Using Deep Convolutional Neural Networks Based on Decompressed Images

Preparing Remote Sensing Data for Natural Resources Mapping (image enhancement, rectifications )

Image analysis. CS/CME/BIOPHYS/BMI 279 Fall 2015 Ron Dror

Filtering Images in the Spatial Domain Chapter 3b G&W. Ross Whitaker (modified by Guido Gerig) School of Computing University of Utah

Number Plate Detection with a Multi-Convolutional Neural Network Approach with Optical Character Recognition for Mobile Devices

Filters. Materials from Prof. Klaus Mueller

CS 4501: Introduction to Computer Vision. Filtering and Edge Detection

Sketch-a-Net that Beats Humans

Lecture 4: Spatial Domain Processing and Image Enhancement

Image Enhancement using Histogram Equalization and Spatial Filtering

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

An Introduction to Convolutional Neural Networks. Alessandro Giusti Dalle Molle Institute for Artificial Intelligence Lugano, Switzerland

Image Filtering. Median Filtering

Lecture #10. EECS490: Digital Image Processing

Evoked Potentials (EPs)

Table of contents. Vision industrielle 2002/2003. Local and semi-local smoothing. Linear noise filtering: example. Convolution: introduction

Lecture 23 Deep Learning: Segmentation

Image interpretation and analysis

Deconvolution , , Computational Photography Fall 2018, Lecture 12

ACM Fast Image Convolutions. by: Wojciech Jarosz

Lec 05 - Linear Filtering & Edge Detection

CS 7643: Deep Learning

CSC 320 H1S CSC320 Exam Study Guide (Last updated: April 2, 2015) Winter 2015

8.2 IMAGE PROCESSING VERSUS IMAGE ANALYSIS Image processing: The collection of routines and

Digital Image Processing

Thinking in Frequency

CSE 166: Image Processing. Overview. What is an image? Representing an image. What is image processing? History. Today

Computing for Engineers in Python

ELE 882: Introduction to Digital Image Processing (DIP)

06: Thinking in Frequencies. CS 5840: Computer Vision Instructor: Jonathan Ventura

Image restoration and color image processing

More image filtering , , Computational Photography Fall 2017, Lecture 4

Introduction to Filters

Applications of Music Processing

Filip Malmberg 1TD396 fall 2018 Today s lecture

Image Filtering in Spatial domain. Computer Vision Jia-Bin Huang, Virginia Tech

Seismic fault detection based on multi-attribute support vector machine analysis

Transcription:

CPSC 340: Machine Learning and Data Mining Convolutional Neural Networks Fall 2018

Admin Mike and I finish CNNs on Wednesday. After that, we will cover different topics: Mike will do a demo of training CNNs with cloud/gpu resources. I am planning to cover boosting (the other type of ensemble method). The lecture will probably be 90 minutes (I won t be offended if you leave early, extra time won t be testable). Friday s lectures will also be different: Mike will do a course review in his section. Aline Tabet will give a guest lecture in this section ( ML Applications in Medicine ). Final: Thursday December 13 th at 8:30am in WOOD 2. Similar style of questions to midterm. 2 pages of notes. CPSC 532M students: course project due December 19 (details on Piazza).

Consider our original signal : Last Time: Convolutions For each time : Compute dot-product of signal at surrounding times with a filter. This gives a new signal : Measures a property of neighbourhood. This particular filter shows a local how spiky value.

1D convolution example: Signal: 1D Convolution Filter: Convolution:

1D convolution example: Signal: 1D Convolution Filter: Convolution:

1D Convolution Examples Examples: Identity Translation

1D Convolution Examples Examples: Identity Local Average

Boundary Issue What can we do about the? at the edges? Can assign values past the boundaries: Zero : Replicate : Mirror : Or just ignore the? values and return a shorter vector:

1D Convolution Examples Translation convolution shift signal:

1D Convolution Examples Averaging convolution computes local mean:

1D Convolution Examples Averaging over bigger window gives coarser view of signal:

1D Convolution Examples Gaussian convolution blurs signal: Compared to averaging it s more smooth and maintains peaks better.

1D Convolution Examples Sharpen convolution enhances peaks. An average that places negative weights on the surrounding pixels.

1D Convolution Examples Laplacian convolution approximates second derivative: Sum to zero filters respond if input vector looks like the filter

Digression: Derivatives and Integrals Numerical derivative approximations can be viewed as filters: Centered difference: [-1, 0, 1] (derivativecheck in findmin). Numerical integration approximations can be viewed as filters: Simpson s rule: [1/6, 4/6, 1/6] (a bit like Gaussian filter). Derivative filters add to 0, integration filters add to 1, For constant function, derivative should be 0 and average = constant. 15

1D Convolution Examples Laplacian of Gaussian is a smoothed 2 nd -derivative approximation:

1D Convolution Examples We often use maximum over several convolutions as features: Below is maximum of Laplacian of Gaussian at i and its 16 KNNs. We use different convolutions as our features (derivatives, integrals, etc.).

Images and Higher-Order Convolution 2D convolution: Signal x is the pixel intensities in an n by n image. Filter w is the pixel intensities in a 2m+1 by 2m+1 image. The 2D convolution is given by: 3D and higher-order convolutions are defined similarly. https://github.com/vdumoulin/conv_arithmetic

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples http://setosa.io/ev/image-kernels

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

Image Convolution Examples

3D Convolution

3D Convolution

3D Convolution

3D Convolution

3D Convolution

Filter Banks To characterize context, we used to use filter bank like MR8 : 1 Gaussian filter, 1 Laplacian of Gaussian filter. 6 max(gabor) filters: 3 scales of sine/cosine (maxed over orientations). Convolutional neural networks are now replacing filter banks. http://www.robots.ox.ac.uk/~vgg/research/texclass/filters.html

(pause)

1D Convolution as Matrix Multiplication Each element of a convolution is an inner product: So convolution is a matrix multiplication (I m ignoring boundaries): The shorter w is, the more sparse the matrix is.

1D Convolution as Matrix Multiplication 1D convolution: Takes signal x and filter w to produces vector z : Can be written as a matrix multiplication:

2D Convolution as Matrix Multiplication 2D convolution: Signal x, filter w, and output z are now all images/matrices: Vectorized z can be written as a matrix multiplication with vectorized x :

Motivation for Convolutional Neural Networks Consider training neural networks on 256 by 256 images. This is 256 by 256 by 3 200,000 inputs. If first layer has k=10,000, then it has about 2 billion parameters. We want to avoid this huge number (due to storage and overfitting). Key idea: make Wx i act like several convolutions (to make it sparse): 1. Each row of W only applies to part of x i. 2. Use the same parameters between rows. Forces most weights to be zero, reduces number of parameters.

Motivation for Convolutional Neural Networks Classic vision methods uses fixed convolutions as features: Usually have different types/variances/orientations. Can do subsampling or take maxes across locations/orientations/scales.

Motivation for Convolutional Neural Networks Convolutional neural networks learn the features: Learning W and v automatically chooses types/variances/orientations. Don t pick from fixed convolutions, but learn the elements of the filters.

Convolutional Neural Networks Convolutional Neural Networks classically have 3 layer types : Fully connected layer: usual neural network layer with unrestricted W.

Convolutional Neural Networks Convolutional Neural Networks classically have 3 layer types : Fully connected layer: usual neural network layer with unrestricted W. Convolutional layer: restrict W to act like several convolutions.

Convolutional Neural Networks Convolutional Neural Networks classically have 3 layer types : Fully connected layer: usual neural network layer with unrestricted W. Convolutional layer: restrict W to act like several convolutions. Pooling layer: combine results of convolutions. Can add invariances or just make the number of parameters smaller. Usual choice is max pooling :

LeNet for Optical Character Recognition http://blog.csdn.net/strint/article/details/44163869

Summary Convolutions are flexible class of signal/image transformations. Can approximate directional derivatives and integrals at different scales. Max(convolutions) can yield features that make classification easy. Convolutional neural networks: Restrict W (m) matrices to represent sets of convolutions. Often combined with max (pooling). Next time: modern convolutional neural networks and applications. Image segmentation, depth estimation, image colorization, artistic style.

FFT implementation of convolution Convolutions can be implemented using fast Fourier transform: Take FFT of image and filter, multiply elementwise, and take inverse FFT. It has faster asymptotic running time but there are some catches: You need to be using periodic boundary conditions for the convolution. Constants matter: it may not be faster in practice. Especially compared to using GPUs to do the convolution in hardware. The gains are largest for larger filters (compared to the image size). 54

Image Coordinates Should we use the image coordinates? E.g., the pixel is at location (124, 78) in the image. Considerations: Is the interpretation different in different areas of the image? Are you using a linear model? Would distance to center be more logical? Do you have enough data to learn about all areas of the image?

Alignment-Based Features The position in the image is important in brain tumour application. But we didn t have much data, so coordinates didn t make sense. We aligned the images with a template image.

Alignment-Based Features The position in the image is important in brain tumour application. But we didn t have much data, so coordinates didn t make sense. We aligned the images with a template image. Allowed alignment-based features:

Motivation: Automatic Brain Tumor Segmentation Final features for brain tumour segmentation: MR8 filter bank applied to original T1, T2, and T1 contrast T1 original. Gaussian convolution with 3 variances of alignment-based features.

SIFT Features Scale-invariant feature transform (SIFT): Features used for object detection ( is particular object in the image?) Designed to detect unique visual features of objects at multiple scales. Proven useful for a variety of object detection tasks. http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.html