2. Who am I ?
Development Experience
◆ Image Recognition using Neural Network
◆ Bio-Medical Data Processing
◆ Human Brain Mapping on High Performance
Computing
◆ Medical Image Reconstruction
(Computer Tomography)
◆ Enterprise System
◆ Open Source Software Developer
Open Source Software Developer
◆ Linux Kernel & LLVM
◆ OPNFV (NFV&SDN) & OpenStack
◆ Machine Learning (TensorFlow)
Book
◆ Unix V6 Kernel
Korea Open Source Software Lab.
Mario Cho
hephaex@gmail.com
3. Contents
• 우리가 본다!
• 기초부터 MNIST
• CIF영상인식
• 학습 데이터 만들기
• Tensorflow에 적용
• 그리고 전설로.
6. Neural network vs Learning
network
Neural Network Deep Learning Network
Human Neural network vs. Machine Learning network
7. Traditional learning vs Deep Machine Learning
Eiffel Tower
Eiffel Tower
RAW data
RAW data
Deep
Learning
Network
Feature
Extraction
Vectored Classification
Traditional Learning
Deep Learning
8. Caffe
U.C. Berkley 개발
C++, Python, MATLAB
대표적인 기계학습을 위한 공개 소프트웨어
* Source: http://caffe.berkeleyvision.org
10. Hierarchical Representation of Deep Learning
* Source: : Honglak Lee and colleagues (2011) as published in “Unsupervised Learning of Hierarchical Representations
with Convolutional Deep Belief Networks”.
19. CIFAR-10 data
• Image Data의 특징
– 10종류로 32x32로 된 인식 + 이미지로 구성
– 학습 데이터(Training data)
– data_batch_1.bin, data_batch_2.bin, … , data_batch_5.bin
– 테스트 데이터(Test data)
– test_batch.bin
• 1개의 이미지 파일(image file)
– 32(가로) x 32(세로) x 3(RGB) = 3072 byte
– 3 tensor image (RGB)
• *참조: 텐서 플로우의 이미지 형식
tf.image_summary(tag, tensor, max_images=3, collections = None, Name=None)
– [0, 255].unint8
– 1 tensor: Grayscale
– 3 tensor: RGB
– 4 tensor: RGBA
20. CIFAR-10 learning network
Layer Name Description
conv1 convolution and rectified linear activation.
pool1 max pooling.
norm1 local response normalization.
conv2 convolution and rectified linear activation.
norm2 local response normalization.
pool2 max pooling.
local3 fully connected layer with rectified linear activation.
local4 fully connected layer with rectified linear activation.
softmax_linear Linear transformation to produce logits
24. Face Detection using Haar Cascades
Source: http://opencv-python-tutroals.r eadthedocs.io/en/latest/py_tutorials/py_objdetect/pya_face_detection/py_face_detection.html#face-detection
26. CIFAR-10 data
• TFRecode file
– TensorFlow 에 TFRcords를 이용하여 binary 데이터를 연속된 데이터로 변형.
– 연속된 데이터를 Reader,Writer를 이용해서 읽고 쓸 수 있다.
– 고정 길이가 아닌 구조형 데이터도 읽고 쓰는 처리 가능
– 1 image file 은
– 32(가로) x 32(세로) x 3(RGB) = 3072 byte
– 1 label + 1 file image file 은
– < 1 x label > < 3072 x pixel>
– 1000 label + 1000 image file
– 32 * 32 * 3 * 1000 = 3 072 000 (3MB)
– Filenames, shuffling
– [“files0”, “file1”],
– (“file%d” % i) for I in range(2)
• tf.train.input_producer(input_tensor, element_shape=None,num_epochs=None,shuffle=True, seed=None,capacity=32,
shared_name=None,summary_name=None,name=None)
– input_tensor: 1차 열로 구성
– element_shape: (Optional.) 입력 텐서의 형태
– num_epochs: (Optional.)
– shuffle: (Optional.):데이터를 임으로 섞어 놓을지?
– seed: (Optional.):데이터의 씨앗을 사용?
– capacity: (Optional.): 버퍼를 사용한 입력.
– name: (Optional.) 큐의 이름
30. CNN layer를 바꿔가며 자신만의 방법을…
• X2 conv layers
96 x 96 x 3
48 x 48 x 32
24 x 24 x 64
12 x 12 x 128
6 x 6 x 256
(6 x 6 x 256) * 1024
1024 x 256
256 x 5
Cf. weight compare
- cifar10:
- (5 x 5 x 3 x 64) + (5 x 5 x 64 x 64) + (4096 * 384) + (384 * 192) + (192 * 6)
= 1754944
- X2 conv:
- (3 x 3 x 3 x 32) + (3 x 3x 32 x 64) + (3 x 3 x 64 x 128) + (3 x 3 x 128 x 256) + (9216 x 1024) + (1024 x 256) + (256 x 5)
= 10088544 (5.7x cifar10 )
32. 소결!
• CIFAR-10을 응용하여 얼굴 인식을 해보자.
• 이쁜 언니들 얼굴 자료를 모으고
• 전체 사진에서 Open CV를 이용해서 CIFAR-10에
맞게 얼굴만을 데이터를 수정해서
• CIFAR-10 형식으로 데이터 변환했다.
• 그리고 python cifar-10을 실행하니
• 학습까지 잘되었다? 진짜!?!