Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting Started with CNN (GDG Ahmedabad)

Avatar for Manthan Ladva Manthan Ladva
September 28, 2019

Getting Started with CNN (GDG Ahmedabad)

Avatar for Manthan Ladva

Manthan Ladva

September 28, 2019

More Decks by Manthan Ladva

Other Decks in Technology

Transcript

  1. Topics:- 1. Computer Vision 2. CNN & Types 3. Edge

    Detection 4. Construction & Working of CNN 5. CNNs architectures 6. Data Augmentations 7. Transfer Learning 8. Object Detections 9. YOLO
  2. Computer Vision:- Computer vision is an interdisciplinary scientific field that

    deals with how computers can be made to gain high-level understanding from digital images or videos. From the perspective of engineering, it seeks to automate tasks that the human visual system can do
  3. What is CNN? In deep learning, a convolutional neural network

    is a class of deep neural networks, most commonly applied to analyzing visual imagery. CNNs are regularized versions of multilayer perceptrons. CNN is applied in:- • Image Classifications • Face Recognitions • Video Classificaions • Object Detection • Neural Style Transfer
  4. 3 0 1 2 7 4 1 5 8 9

    3 1 2 7 2 5 1 3 0 1 3 1 7 8 4 2 1 6 2 8 2 4 5 2 3 9 E.G.:- * 1 0 -1 1 0 -1 1 0 -1 Convolution Step 1 :-- (3*1 + 1*1 + 2*1 + 0*0 + 5*0 + 7*0 + 1*-1 + 8*-1 + 2*-1) “1 Step Aagad Vadho” Step 2 :-- (0*1 + 5*1 + 7*1 + 1*0 + 8*0 + 2*0 + 2*-1 + 9*-1 + 5*-1) . “Evi Rite Niche” Step 5 :-- (1*1 + 2*1 + 0*1 + 5*0 + 7*0 + 1*0 + 8*-1 + 2*-1 + 3*-1) -5 -4 0 8 -10 -2 2 3 0 -2 -4 -7 -3 -2 -3 -16 6 x 6 Vertical Filter of 3x3 =
  5. 3 0 1 2 7 4 1 5 8 9

    3 1 2 7 2 5 1 3 0 1 3 1 7 8 4 2 1 6 2 8 2 4 5 2 3 9 E.G.:- * 1 0 -1 1 0 -1 1 0 -1 Convolution Step 1 :-- (3*1 + 1*1 + 2*1 + 0*0 + 5*0 + 7*0 + 1*-1 + 8*-1 + 2*-1) “1 Step Aagad Vadho” Step 2 :-- (0*1 + 5*1 + 7*1 + 1*0 + 8*0 + 2*0 + 2*-1 + 9*-1 + 5*-1) . “Evi Rite Niche” Step 5 :-- (1*1 + 2*1 + 0*1 + 5*0 + 7*0 + 1*0 + 8*-1 + 2*-1 + 3*-1) -5 -4 0 8 -10 -2 2 3 0 -2 -4 -7 -3 -2 -3 -16 6 x 6 Vertical Filter of 3x3 =
  6. 3 0 1 2 7 4 1 5 8 9

    3 1 2 7 2 5 1 3 0 1 3 1 7 8 4 2 1 6 2 8 2 4 5 2 3 9 E.G.:- * 1 0 -1 1 0 -1 1 0 -1 Convolution Step 1 :-- (3*1 + 1*1 + 2*1 + 0*0 + 5*0 + 7*0 + 1*-1 + 8*-1 + 2*-1) “1 Step Aagad Vadho” Step 2 :-- (0*1 + 5*1 + 7*1 + 1*0 + 8*0 + 2*0 + 2*-1 + 9*-1 + 5*-1) . “Evi Rite Niche” Step 5 :-- (1*1 + 2*1 + 0*1 + 5*0 + 7*0 + 1*0 + 8*-1 + 2*-1 + 3*-1) -5 -4 0 8 -10 -2 2 3 0 -2 -4 -7 -3 -2 -3 -16 6 x 6 Vertical Filter of 3x3 =
  7. Samaj me aya? 1 0 -1 2 0 -2 2

    0 -1 3 0 -3 10 0 -10 3 0 -3 Sobel Filter Schar Filter
  8. * * = = 6x6x3 3x3x3 4x4 Horizontal Vertical 4x4x2

    (n-f+1) x (n-f+1) x nc’ Where:- nc’ = no. of channels Here( 4x4x2 )
  9. Padding (p):- 0 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 * = Pela mate ni formula (Valid) :- (n-f+1 , n-f+1) After adding padding ni formula (Same) :- (n+2p-f+1 , n+2p-f+1) nXn fXf pXp n+2p-f+1 = n p = (f-1)/2
  10. Stride (s) :- a b c d e f g

    h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 4 4 1 0 2 -1 0 3 1 2 3 4 5 6 7 8 9 * = | ((n + 2p -f)/s) +1 | x | ((n + 2p -f)/s) +1 | 7x7 3x3 3x3 S = 2
  11. Pooling :- 1 2 3 4 5 6 7 8

    9 10 11 12 13 14 15 16 6 8 14 16 4x4 2x2 Used for Image compression Hyperparameters ( Nuisance Parameters ) :- 1. Filter Size 2. Strides 3. Max Pool or Average Pool nh x nw x nc | ((nh-f)/s)+1 | x | ((nh-f)/s)+1 | x nc Note :- Parameters che j nai
  12. Image Conv - 1 Pool - 1 Conv - 2

    Pool - 1 asi = 32x32x3 f=5x5 s=1 28x28x6 14x14x6 10x10x16 5x5x16 NN Layer 1 NN Layer 2 NN Layer 3 120x1 84x1 10x1 E.g. :- Layer 1 Layer 2 f =2x2 s=2 maxpool f=5x5 s=1 f =2x2 s=2 maxpool Part 1
  13. Activation Size ↓ Parameters ↑ Conv. formula :- | ((n

    + 2p -f)/s) +1 | Pool. formula :- | ((n-f)/s)+1 | Parameters for. :- [ {f x f} + 1] x nc asi = Activation Size ash = Activation Shape = (solve asi) Part 2
  14. There are various architectures of CNNs available which have been

    key in building algorithms which power and shall power AI as a whole in the foreseeable future. Some of them have been listed below :- 1. LeNet 2. AlexNet 3. VGGNet 4. GoogLeNet or ( Inception ) 5. ResNet Types Of CNNs architectures :-
  15. Transfer Learning :- In Simple words, use the model made

    by other peoples. As simple as that. What do you mean ? Everything we learned, was a bluff ? Nope, Just use the model which are trained on very huge amount of data, & after that connect you code for better result. Enjoy.
  16. List of Transfer Learning models for C.V. :- • VGG-16

    • VGG-19 • Inception V3 • XCeption • ResNet-50 • MobileNet V2 • Image Net
  17. ... Conv. Layer Softmax Object categories :- - Pedestrian -

    Car - MotorCycle - Background {0,0} {1,1} bx,by,bh,bw .
  18. Object categories :- - Pedestrian - Car - MotorCycle -

    Background Pc Bx By Bh Bw Cp Cc Cm 0 ? ? ? ? ? ? ? 1 Bx By Bh Bw 0 1 0 y =
  19. Yolo Algorithm :- Pc Bx By Bh Bw Cp Cc

    Cm y = 1 Bx By Bh Bw 0 1 0 0 ? ? ? ? ? ? ? Target Output = 3x3x8 4 & 6 ( You only look once )
  20. Intersection Over Union ( IOU ) :- IOU = Size

    of -------------------- Size of “ Correct ” if IOU ≥ 0.5
  21. Anchor Boxes :- Pc Bx By Bh Bw Cp Cc

    Cm Pc Bx By Bh Bw Cp Cc Cm y = } } } Anchor Box 1 } } } } } } Anchor Box 2 } } } Target Output = 3x3x2x8
  22. Thanks for your valuable time... LinkedIn :- https://www.linkedin.com/in/manthan-ladva-506a04116/ Twitter :-

    https://twitter.com/manthan_ladva Github :- https://github.com/manthan-ladva