SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
TensorFlow로
얼굴을	인식해	보자.
공개 소프트웨어 개발자 센터
(KOSS	Lab. 2기)
Mario	Cho	(조만석)
hephaex@gmail.com
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
Contents
• 우리가 본다!
• 기초부터 MNIST
• CIF영상인식
• 학습 데이터 만들기
• Tensorflow에 적용
• 그리고 전설로.
Human Intelligence
Human Brain
Source: https://www.ll.mit.edu/publications/journal/pdf/vol 04_no2/4.2.5.neuralnetwork.pdf
Neural network vs Learning
network
Neural Network Deep Learning Network
Human Neural network vs. Machine Learning network
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
Caffe
U.C. Berkley 개발
C++, Python, MATLAB
대표적인 기계학습을 위한 공개 소프트웨어
* Source: http://caffe.berkeleyvision.org
TensorFlow
* Source: https://www.tensorflow.org/
Hierarchical Representation of Deep Learning
* Source: : Honglak Lee and colleagues (2011) as published in “Unsupervised Learning of Hierarchical Representations
with Convolutional Deep Belief Networks”.
Hello World on TensorFlow
Image recognition in Google Map
* Source: Oriol Vinyals – Research Scientistat Google Brain
Hello World == MNIST
Data Sets data_sets.train 55000 images & labels
data_sets.validation 5000 images & labels
data_sets.test 10000 images & labels
MNIST (predict number of image)
MNIST beginner code
Face recognition?
CIFAR-10
• CIFAR-10
– 32x32 크기로 컬러 영상
– 10종류로 구분됨.
– TensorFlow 예제: tensorflow/models/image/cifar10/
CIFAR-10 Model
Data Sets data_sets.train 50000 images & labels
data_sets.validation 1000 images & labels
data_sets.test 10000 images & labels
Source: http://www.cs.toronto.edu/~kriz/cifar.html
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
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
Source data: 얼굴 인식에 사용할 사진을 모으자!
Prepare: 사진에서 얼굴만 추출하자.
OpenCV
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
Open CV: face dectec code
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.) 큐의 이름
CIFAR-10 data sets 형식으로 바꾸자.
CIFAR-10 에서 대상을 얼굴 추출 자료로 바꾸자.
TensorFlow Training
– 학습이 잘 된 것처럼 보이나되어서 평가를 해보면
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 )
CNN 2x code
소결!
• CIFAR-10을 응용하여 얼굴 인식을 해보자.
• 이쁜 언니들 얼굴 자료를 모으고
• 전체 사진에서 Open CV를 이용해서 CIFAR-10에
맞게 얼굴만을 데이터를 수정해서
• CIFAR-10 형식으로 데이터 변환했다.
• 그리고 python cifar-10을 실행하니
• 학습까지 잘되었다? 진짜!?!
뭐
가
문
제
냐
?
face extraction
#1. No. of Face data
# 2. Face extraction method
#3. advanced face detect
#4 View side effect
Source: http://socialsciences.uow.edu.au/psychology/research/pcl/members/UOW040587.html
#5 Emphasis?
#6. Eigen faces
Source: http://jbhuang0604.blogspot.kr/2013/04/miss-korea-2013-contestants-face.html
#6. Converging on the same face
Source: http://jbhuang0604.blogspot.kr/2013/04/miss-korea-2013-contestants-face.html
Make Her Beautiful?
Source: http://www.estherhonig.com
Thanks you!
Q&A

Contenu connexe

Tendances

인공신경망
인공신경망인공신경망
인공신경망종열 현
 
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016Taehoon Kim
 
개발자를 위한 공감세미나 tensor-flow
개발자를 위한 공감세미나 tensor-flow개발자를 위한 공감세미나 tensor-flow
개발자를 위한 공감세미나 tensor-flow양 한빛
 
영상 데이터의 처리와 정보의 추출
영상 데이터의 처리와 정보의 추출영상 데이터의 처리와 정보의 추출
영상 데이터의 처리와 정보의 추출동윤 이
 
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)WON JOON YOO
 
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016Taehoon Kim
 
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)Tae Young Lee
 
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)WON JOON YOO
 
Deep learning framework 제작
Deep learning framework 제작Deep learning framework 제작
Deep learning framework 제작Tae Young Lee
 
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기Ki-Hwan Kim
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용Youngjae Kim
 
파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI )
파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI ) 파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI )
파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI ) Yunho Maeng
 
Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tae Young Lee
 
파이썬 데이터 분석 3종세트
파이썬 데이터 분석 3종세트파이썬 데이터 분석 3종세트
파이썬 데이터 분석 3종세트itproman35
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016Taehoon Kim
 
Deview deep learning-김정희
Deview deep learning-김정희Deview deep learning-김정희
Deview deep learning-김정희NAVER D2
 
Io17ex automl & autodraw
Io17ex automl & autodrawIo17ex automl & autodraw
Io17ex automl & autodrawTae Young Lee
 
[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_sparkNAVER D2
 

Tendances (19)

인공신경망
인공신경망인공신경망
인공신경망
 
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
 
개발자를 위한 공감세미나 tensor-flow
개발자를 위한 공감세미나 tensor-flow개발자를 위한 공감세미나 tensor-flow
개발자를 위한 공감세미나 tensor-flow
 
영상 데이터의 처리와 정보의 추출
영상 데이터의 처리와 정보의 추출영상 데이터의 처리와 정보의 추출
영상 데이터의 처리와 정보의 추출
 
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
 
파이썬 데이터 분석 (18년)
파이썬 데이터 분석 (18년)파이썬 데이터 분석 (18년)
파이썬 데이터 분석 (18년)
 
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
 
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
 
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
 
Deep learning framework 제작
Deep learning framework 제작Deep learning framework 제작
Deep learning framework 제작
 
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 코드들과 연동하기
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI )
파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI ) 파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI )
파이썬(Python) 으로 나만의 딥러닝 API 만들기 강좌 (Feat. AutoAI )
 
Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)
 
파이썬 데이터 분석 3종세트
파이썬 데이터 분석 3종세트파이썬 데이터 분석 3종세트
파이썬 데이터 분석 3종세트
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
 
Deview deep learning-김정희
Deview deep learning-김정희Deview deep learning-김정희
Deview deep learning-김정희
 
Io17ex automl & autodraw
Io17ex automl & autodrawIo17ex automl & autodraw
Io17ex automl & autodraw
 
[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark
 

Similaire à Tfk 6618 tensor_flow로얼굴인식구현_r10_mariocho

[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담
[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담
[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담Sumin Byeon
 
텐서플로우 2.0 튜토리얼 - CNN
텐서플로우 2.0 튜토리얼 - CNN텐서플로우 2.0 튜토리얼 - CNN
텐서플로우 2.0 튜토리얼 - CNNHwanhee Kim
 
딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)Tae Young Lee
 
[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)Donghyeon Kim
 
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점if kakao
 
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Mad Scientists
 
Deep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetHyojun Kim
 
Cnn 발표자료
Cnn 발표자료Cnn 발표자료
Cnn 발표자료종현 최
 
Ch.5 Deep Learning
Ch.5 Deep LearningCh.5 Deep Learning
Ch.5 Deep LearningPartPrime
 
Workshop 210417 dhlee
Workshop 210417 dhleeWorkshop 210417 dhlee
Workshop 210417 dhleeDongheon Lee
 
Deep learning의 이해
Deep learning의 이해Deep learning의 이해
Deep learning의 이해KwangPil Hong
 
미래경진대회(Object detection) 설명 자료
미래경진대회(Object detection) 설명 자료미래경진대회(Object detection) 설명 자료
미래경진대회(Object detection) 설명 자료DACON AI 데이콘
 
2017 tensor flow dev summit
2017 tensor flow dev summit2017 tensor flow dev summit
2017 tensor flow dev summitTae Young Lee
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesKang Pilsung
 

Similaire à Tfk 6618 tensor_flow로얼굴인식구현_r10_mariocho (20)

[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담
[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담
[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담
 
텐서플로우 2.0 튜토리얼 - CNN
텐서플로우 2.0 튜토리얼 - CNN텐서플로우 2.0 튜토리얼 - CNN
텐서플로우 2.0 튜토리얼 - CNN
 
Naive ML Overview
Naive ML OverviewNaive ML Overview
Naive ML Overview
 
딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)
 
[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)
 
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
 
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
 
Deep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNet
 
Dl from scratch(7)
Dl from scratch(7)Dl from scratch(7)
Dl from scratch(7)
 
Cnn 발표자료
Cnn 발표자료Cnn 발표자료
Cnn 발표자료
 
Mylab
MylabMylab
Mylab
 
Ch.5 Deep Learning
Ch.5 Deep LearningCh.5 Deep Learning
Ch.5 Deep Learning
 
Workshop 210417 dhlee
Workshop 210417 dhleeWorkshop 210417 dhlee
Workshop 210417 dhlee
 
LeNet & GoogLeNet
LeNet & GoogLeNetLeNet & GoogLeNet
LeNet & GoogLeNet
 
Deep learning의 이해
Deep learning의 이해Deep learning의 이해
Deep learning의 이해
 
미래경진대회(Object detection) 설명 자료
미래경진대회(Object detection) 설명 자료미래경진대회(Object detection) 설명 자료
미래경진대회(Object detection) 설명 자료
 
Feature Pyramid Network, FPN
Feature Pyramid Network, FPNFeature Pyramid Network, FPN
Feature Pyramid Network, FPN
 
Python
PythonPython
Python
 
2017 tensor flow dev summit
2017 tensor flow dev summit2017 tensor flow dev summit
2017 tensor flow dev summit
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniques
 

Plus de Mario Cho

Python pyenv virtualenv
Python pyenv virtualenvPython pyenv virtualenv
Python pyenv virtualenvMario Cho
 
Open source ai_technical_trend
Open source ai_technical_trendOpen source ai_technical_trend
Open source ai_technical_trendMario Cho
 
A.I. Exercise.
A.I. Exercise.A.I. Exercise.
A.I. Exercise.Mario Cho
 
제로부터시작하는 Git 두번째 이야기
제로부터시작하는 Git 두번째 이야기제로부터시작하는 Git 두번째 이야기
제로부터시작하는 Git 두번째 이야기Mario Cho
 
제로부터시작하는Git
제로부터시작하는Git제로부터시작하는Git
제로부터시작하는GitMario Cho
 
오픈소스로 시작하는 인공지능 실습
오픈소스로 시작하는 인공지능 실습오픈소스로 시작하는 인공지능 실습
오픈소스로 시작하는 인공지능 실습Mario Cho
 
Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기
Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기 Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기
Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기 Mario Cho
 
Deep machine learning by Mario Cho
Deep machine learning by Mario ChoDeep machine learning by Mario Cho
Deep machine learning by Mario ChoMario Cho
 
Introduce Deep learning & A.I. Applications
Introduce Deep learning & A.I. ApplicationsIntroduce Deep learning & A.I. Applications
Introduce Deep learning & A.I. ApplicationsMario Cho
 
제로부터시작하는오픈소스
제로부터시작하는오픈소스제로부터시작하는오픈소스
제로부터시작하는오픈소스Mario Cho
 
Re: 제로부터시작하는텐서플로우
Re: 제로부터시작하는텐서플로우Re: 제로부터시작하는텐서플로우
Re: 제로부터시작하는텐서플로우Mario Cho
 
Koss 6 a17_deepmachinelearning_mariocho_r10
Koss 6 a17_deepmachinelearning_mariocho_r10Koss 6 a17_deepmachinelearning_mariocho_r10
Koss 6 a17_deepmachinelearning_mariocho_r10Mario Cho
 
Open stack 4day
Open stack 4dayOpen stack 4day
Open stack 4dayMario Cho
 
티벳 사자의 서: 환생론/우주관
티벳 사자의 서: 환생론/우주관티벳 사자의 서: 환생론/우주관
티벳 사자의 서: 환생론/우주관Mario Cho
 
EMT machine learning 12th weeks : Anomaly detection
EMT machine learning 12th weeks : Anomaly detectionEMT machine learning 12th weeks : Anomaly detection
EMT machine learning 12th weeks : Anomaly detectionMario Cho
 
ESM Machine learning 5주차 Review by Mario Cho
ESM Machine learning 5주차 Review by Mario ChoESM Machine learning 5주차 Review by Mario Cho
ESM Machine learning 5주차 Review by Mario ChoMario Cho
 
ESM Mid term Review
ESM Mid term ReviewESM Mid term Review
ESM Mid term ReviewMario Cho
 
ESM SVM & Unsupervised Learning
ESM SVM & Unsupervised LearningESM SVM & Unsupervised Learning
ESM SVM & Unsupervised LearningMario Cho
 
Koss 1605 machine_learning_mariocho_t10
Koss 1605 machine_learning_mariocho_t10Koss 1605 machine_learning_mariocho_t10
Koss 1605 machine_learning_mariocho_t10Mario Cho
 
Storage based on_openstack_mariocho
Storage based on_openstack_mariochoStorage based on_openstack_mariocho
Storage based on_openstack_mariochoMario Cho
 

Plus de Mario Cho (20)

Python pyenv virtualenv
Python pyenv virtualenvPython pyenv virtualenv
Python pyenv virtualenv
 
Open source ai_technical_trend
Open source ai_technical_trendOpen source ai_technical_trend
Open source ai_technical_trend
 
A.I. Exercise.
A.I. Exercise.A.I. Exercise.
A.I. Exercise.
 
제로부터시작하는 Git 두번째 이야기
제로부터시작하는 Git 두번째 이야기제로부터시작하는 Git 두번째 이야기
제로부터시작하는 Git 두번째 이야기
 
제로부터시작하는Git
제로부터시작하는Git제로부터시작하는Git
제로부터시작하는Git
 
오픈소스로 시작하는 인공지능 실습
오픈소스로 시작하는 인공지능 실습오픈소스로 시작하는 인공지능 실습
오픈소스로 시작하는 인공지능 실습
 
Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기
Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기 Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기
Koss Lab 세미나 오픈소스 인공지능(AI) 프레임웍파헤치기
 
Deep machine learning by Mario Cho
Deep machine learning by Mario ChoDeep machine learning by Mario Cho
Deep machine learning by Mario Cho
 
Introduce Deep learning & A.I. Applications
Introduce Deep learning & A.I. ApplicationsIntroduce Deep learning & A.I. Applications
Introduce Deep learning & A.I. Applications
 
제로부터시작하는오픈소스
제로부터시작하는오픈소스제로부터시작하는오픈소스
제로부터시작하는오픈소스
 
Re: 제로부터시작하는텐서플로우
Re: 제로부터시작하는텐서플로우Re: 제로부터시작하는텐서플로우
Re: 제로부터시작하는텐서플로우
 
Koss 6 a17_deepmachinelearning_mariocho_r10
Koss 6 a17_deepmachinelearning_mariocho_r10Koss 6 a17_deepmachinelearning_mariocho_r10
Koss 6 a17_deepmachinelearning_mariocho_r10
 
Open stack 4day
Open stack 4dayOpen stack 4day
Open stack 4day
 
티벳 사자의 서: 환생론/우주관
티벳 사자의 서: 환생론/우주관티벳 사자의 서: 환생론/우주관
티벳 사자의 서: 환생론/우주관
 
EMT machine learning 12th weeks : Anomaly detection
EMT machine learning 12th weeks : Anomaly detectionEMT machine learning 12th weeks : Anomaly detection
EMT machine learning 12th weeks : Anomaly detection
 
ESM Machine learning 5주차 Review by Mario Cho
ESM Machine learning 5주차 Review by Mario ChoESM Machine learning 5주차 Review by Mario Cho
ESM Machine learning 5주차 Review by Mario Cho
 
ESM Mid term Review
ESM Mid term ReviewESM Mid term Review
ESM Mid term Review
 
ESM SVM & Unsupervised Learning
ESM SVM & Unsupervised LearningESM SVM & Unsupervised Learning
ESM SVM & Unsupervised Learning
 
Koss 1605 machine_learning_mariocho_t10
Koss 1605 machine_learning_mariocho_t10Koss 1605 machine_learning_mariocho_t10
Koss 1605 machine_learning_mariocho_t10
 
Storage based on_openstack_mariocho
Storage based on_openstack_mariochoStorage based on_openstack_mariocho
Storage based on_openstack_mariocho
 

Tfk 6618 tensor_flow로얼굴인식구현_r10_mariocho

  • 1. TensorFlow로 얼굴을 인식해 보자. 공개 소프트웨어 개발자 센터 (KOSS Lab. 2기) Mario Cho (조만석) hephaex@gmail.com
  • 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”.
  • 11. Hello World on TensorFlow
  • 12. Image recognition in Google Map * Source: Oriol Vinyals – Research Scientistat Google Brain
  • 13. Hello World == MNIST Data Sets data_sets.train 55000 images & labels data_sets.validation 5000 images & labels data_sets.test 10000 images & labels
  • 17. CIFAR-10 • CIFAR-10 – 32x32 크기로 컬러 영상 – 10종류로 구분됨. – TensorFlow 예제: tensorflow/models/image/cifar10/
  • 18. CIFAR-10 Model Data Sets data_sets.train 50000 images & labels data_sets.validation 1000 images & labels data_sets.test 10000 images & labels Source: http://www.cs.toronto.edu/~kriz/cifar.html
  • 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
  • 21. Source data: 얼굴 인식에 사용할 사진을 모으자!
  • 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
  • 25. Open CV: face dectec code
  • 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.) 큐의 이름
  • 27. CIFAR-10 data sets 형식으로 바꾸자.
  • 28. CIFAR-10 에서 대상을 얼굴 추출 자료로 바꾸자.
  • 29. TensorFlow Training – 학습이 잘 된 것처럼 보이나되어서 평가를 해보면
  • 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을 실행하니 • 학습까지 잘되었다? 진짜!?!
  • 35. #1. No. of Face data
  • 36. # 2. Face extraction method
  • 38. #4 View side effect Source: http://socialsciences.uow.edu.au/psychology/research/pcl/members/UOW040587.html
  • 40. #6. Eigen faces Source: http://jbhuang0604.blogspot.kr/2013/04/miss-korea-2013-contestants-face.html
  • 41. #6. Converging on the same face Source: http://jbhuang0604.blogspot.kr/2013/04/miss-korea-2013-contestants-face.html
  • 42. Make Her Beautiful? Source: http://www.estherhonig.com