Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf ·...

20
Identification of Kernels in a Convolutional Neural Network Jonas Actor Rice University 14 October 2019 [email protected]

Transcript of Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf ·...

Page 1: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Identification of Kernels in a Convolutional NeuralNetwork

Jonas ActorRice University

14 October 2019

8 [email protected]

Page 2: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Target application: medical image segmentation

Abdominal CT scan Liver and tumor segmentation

1

Page 3: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 200 2

Page 4: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 200 2

Page 5: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 500 2

Page 6: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 500 2

Page 7: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 1100 2

Page 8: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 1100 2

Page 9: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

Level Set Equation: time = 1500 2

Page 10: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Classical Approach: Level Set Equation

• Well-established theory to analyze approximation, stability• Upwind finite differences + fast marching method• Semiautomated : requires initialization by user• Works for simple problems only : relies on edge information

3

Page 11: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Motivation: LSE vs CNN

Can analyze? Accurate?LSE yes sometimesCNN no yes

Goal: accurate method we can analyze

4

Page 12: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Similarities between LSE and CNN

LSE CNN

Convolution finite difference kernel learned kernel

1h2

0 1 01 −4 10 1 0

k11 k12 k13k21 k22 k23k31 k32 k33

ReLU upwind scheme activation function

max(0,D+ ∗ u) + min(0,D− ∗ u) max(0,K ∗ x + b)

5

Page 13: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Build a CNN like a LSE solver

Level Set Equation −→ Level Set Network

1 Discretize Level Set Equation• Explicit forward Euler in time• Upwind finite differences in space

2 Forward Euler −→ residual skip connections3 Upwind finite differences −→ convolutions and ReLU

6

Page 14: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

LSN: Results

K-Fold LSE LSN Test LSN Validation UNet0 0.736 0.837 0.619 0.9121 0.600 0.847 0.729 0.9192 0.483 0.116 0.005 0.8743 0.730 0.827 0.606 0.8954 0.643 0.831 0.596 0.915

Avg 0.604 0.692 0.511 0.903Avg−{2} 0.640 0.837 0.638 0.911

Table: DSC scores for each fold, from training the level set network.

7

Page 15: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Identification of Kernels

• Are CNN convolution kernels finite difference stencils?• Are they close to finite difference stencils?• What about other standard image processing kernels?

Numerical analysis kernels• Laplacian• Edge detection• Identity

Image processing kernels• Gaussian blur• Local mean• Sharpen

8

Page 16: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Setup of CNN

1 2

3 4

5 6

7 8

10 11 129

13 14

15 16

17 18

= Dropout + Conv2d + ReLU

#

Dense

IN OUT

16

1

16 16

16 16

16 32 32

32 64 64 32 32

32

16

16

16

1

16

1616

16 16

16

32

32

32

32

16

16

MaxPool2dUpsample2d

32

16Concatenate

16 # Channels in/out

Trained on MICCAI LiTS 2017 dataset for liver segmentation

9

Page 17: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Kernel Analysis

• For each layer, separate each channel’s 3× 3 convolution kernel• Flatten each 3× 3 kernel into a vector ∈ R9

• Cluster with k-means• Project down using PCA• Project known numerical analysis and image processing kernels

10

Page 18: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Kernel Clustering Results

Figure: Convolution Layer 11 (encoder) 11

Page 19: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Kernel Clustering Results

Figure: Convolution Layer 14 (decoder) 12

Page 20: Identification of Kernels in a Convolutional Neural Networkjaa5/files/Presentations/RDSC19.pdf · Avgf 2g 0.640 0.837 0.638 0.911 Table:DSC scores for each fold, from training the

Conclusions

• Level Set Equation 6= Level Set Network 6= UNet• Framework for using same operations (convolutions + ReLU) for

both NNs and PDEs• Examine how learned CNN kernels change across different layers

JAA is supported by the NLM Training Program in BiomedicalInformatics & Data Science (T15LM007093), supplemented by theKen Kennedy Institute Computer Science & Engineering EnhancementFellowship, funded by the Rice Oil & Gas HPC Conference. 13