2021년 11월 16일 모두콘에서 발표했던 딥러닝 경량화 & 최적화 슬라이드 입니다.
딥러닝 경량화 & 최적화를 실용적으로 적용하려면 어떻게 해야 할까요? 딥러닝 경량화를 검색하면 이론적으로 매우 많은 자료가 쏟아져 나옵니다. 하지만 실제로 적용을 해보면 효과가 없거나 오히려 역효과가 나는 경우가 있습니다. 이번 모두콘에서 저희가 지금까지 딥러닝 모델 경량화 & 최적화를 진행하면서 어떤 것이 실용적으로 효과가 있었는지에 대해서 공유하려고 합니다.비슷한 주제로 고민 중이고 계셨던 분이시면 편하게 들으러 와주세요.
너무도 아름답고 과학적인 글자, 한글 珞
다른 언어에 비해 손글씨 데이터셋이 적고, 만들어진 손글씨 예측 모델의 인식률이 낮은 점이 아쉬워 직접 데이터를 생성하고 간단한 iOS 애플리케이션을 만들어봤습니다.
2019년 2월 23일 KCD 행사에서 케라스 코리아 팀에서 발표했던 자료를 보완/수정했습니다.
관련 코드는 아래 링크에서 확인할 수 있습니다.
https://github.com/MijeongJeon/KoreanClassification_Keras_Coreml
2021년 11월 16일 모두콘에서 발표했던 딥러닝 경량화 & 최적화 슬라이드 입니다.
딥러닝 경량화 & 최적화를 실용적으로 적용하려면 어떻게 해야 할까요? 딥러닝 경량화를 검색하면 이론적으로 매우 많은 자료가 쏟아져 나옵니다. 하지만 실제로 적용을 해보면 효과가 없거나 오히려 역효과가 나는 경우가 있습니다. 이번 모두콘에서 저희가 지금까지 딥러닝 모델 경량화 & 최적화를 진행하면서 어떤 것이 실용적으로 효과가 있었는지에 대해서 공유하려고 합니다.비슷한 주제로 고민 중이고 계셨던 분이시면 편하게 들으러 와주세요.
너무도 아름답고 과학적인 글자, 한글 珞
다른 언어에 비해 손글씨 데이터셋이 적고, 만들어진 손글씨 예측 모델의 인식률이 낮은 점이 아쉬워 직접 데이터를 생성하고 간단한 iOS 애플리케이션을 만들어봤습니다.
2019년 2월 23일 KCD 행사에서 케라스 코리아 팀에서 발표했던 자료를 보완/수정했습니다.
관련 코드는 아래 링크에서 확인할 수 있습니다.
https://github.com/MijeongJeon/KoreanClassification_Keras_Coreml
Autonomous drive robot for smart factory. This project is just prototype. We used Turtlebot3, RaspberryRi3. Used software & tools are TensorFlow, openCV, etc..
[AWS Innovate 온라인 컨퍼런스] 수백만 사용자 대상 기계 학습 서비스를 위한 확장 비법 - 윤석찬, AWS 테크 에반젤리스트Amazon Web Services Korea
발표자료 다시보기: https://youtu.be/RYzviz-uOCU
기계 학습은 이제 개발자에게 필수 기술셋이 되었습니다. 본 세션에서는 AWS의 다양한 인공 지능 서비스를 활용하여 개발자들이 기계 학습을 처음 접하는 시점부터 혼자서 공부하는 방법부터 팀에서 초기 도입시, 그리고 정식 프로덕션 환경에서 수백만 사용자를 위한 서비스를 향해 가는 과정을 알려드림으로서 기계 학습 기반 개발자가 될 수 있는 방법을 알아봅니다.
[Let's Swift 2019] iOS 앱에서 머신러닝이 해결 할 수 있는 문제들Doyoung Gwak
iOS에서 머신러닝으로 해결할 수 있는 문제들을 다양한 예시와 함께 소개합니다. 기존에 룰베이스 알고리즘으로는 해결하기 힘들었던 어려운 문제들을 머신러닝이 어떻게 해결할 수 있는지 설명하고, 간단한 코드 예제와 함께 Core ML 사용법을 알려드립니다. 또한 서비스에 사용하는 모델의 경우 어떤 추가적인 고려를 해야하는지도 간략히 소개하고 있습니다.
본 발표에 공유된 대부분의 데모는 https://github.com/motlabs/awesome-ml-demos-with-ios 저장소에 올라가있어, 코드 레벨까지 궁금한 분들께서는 이 저장소를 확인해주세요.
발표영상: https://www.youtube.com/watch?v=zKPB8rnS-EM
FLUTTER with AI tensorflow
How to build a TensorFlow model in Flutter and
tensorflow model convert to tensorflow lite model
This presentation describes how to build an AI app easily.
Progress Indicators - Affective Engineering PresentationByoungHern Kim
The document discusses different types of progress indicators and how users perceive them. It begins by explaining that progress indicators inform users when a task is processing without noticeable delays. The author then outlines a study where adjectives were collected to describe progress indicators and 11 stimulus were created testing linear vs circular designs and animated vs static visuals. Users participated in a survey to rate the stimuli and results showed circular animated designs were seen as most intuitive and enjoyable while linear static designs were less so. The author concludes looping circular progress indicators gentle animated are best perceived.
Autonomous drive robot for smart factory. This project is just prototype. We used Turtlebot3, RaspberryRi3. Used software & tools are TensorFlow, openCV, etc..
[AWS Innovate 온라인 컨퍼런스] 수백만 사용자 대상 기계 학습 서비스를 위한 확장 비법 - 윤석찬, AWS 테크 에반젤리스트Amazon Web Services Korea
발표자료 다시보기: https://youtu.be/RYzviz-uOCU
기계 학습은 이제 개발자에게 필수 기술셋이 되었습니다. 본 세션에서는 AWS의 다양한 인공 지능 서비스를 활용하여 개발자들이 기계 학습을 처음 접하는 시점부터 혼자서 공부하는 방법부터 팀에서 초기 도입시, 그리고 정식 프로덕션 환경에서 수백만 사용자를 위한 서비스를 향해 가는 과정을 알려드림으로서 기계 학습 기반 개발자가 될 수 있는 방법을 알아봅니다.
[Let's Swift 2019] iOS 앱에서 머신러닝이 해결 할 수 있는 문제들Doyoung Gwak
iOS에서 머신러닝으로 해결할 수 있는 문제들을 다양한 예시와 함께 소개합니다. 기존에 룰베이스 알고리즘으로는 해결하기 힘들었던 어려운 문제들을 머신러닝이 어떻게 해결할 수 있는지 설명하고, 간단한 코드 예제와 함께 Core ML 사용법을 알려드립니다. 또한 서비스에 사용하는 모델의 경우 어떤 추가적인 고려를 해야하는지도 간략히 소개하고 있습니다.
본 발표에 공유된 대부분의 데모는 https://github.com/motlabs/awesome-ml-demos-with-ios 저장소에 올라가있어, 코드 레벨까지 궁금한 분들께서는 이 저장소를 확인해주세요.
발표영상: https://www.youtube.com/watch?v=zKPB8rnS-EM
FLUTTER with AI tensorflow
How to build a TensorFlow model in Flutter and
tensorflow model convert to tensorflow lite model
This presentation describes how to build an AI app easily.
Progress Indicators - Affective Engineering PresentationByoungHern Kim
The document discusses different types of progress indicators and how users perceive them. It begins by explaining that progress indicators inform users when a task is processing without noticeable delays. The author then outlines a study where adjectives were collected to describe progress indicators and 11 stimulus were created testing linear vs circular designs and animated vs static visuals. Users participated in a survey to rate the stimuli and results showed circular animated designs were seen as most intuitive and enjoyable while linear static designs were less so. The author concludes looping circular progress indicators gentle animated are best perceived.
This document discusses longitudinal methods for assessing user experience over time with digital products. It presents qualitative and quantitative longitudinal approaches, including diary studies, experience sampling, day reconstruction interviews, and questionnaires. Specific studies examined include exploring how users' experiences with an iPhone change over 1-4 weeks and understanding how usage styles of smartwatches transform with long-term use. The document also discusses a qualitative study on a data collection device called The Datacatcher and poses a question about examining user experience with smart speakers longitudinally.
The document discusses tangible interaction in the dentist's office, specifically a device for inputting pain levels. It first mentions a graduate project on this topic from 2021. It then discusses two relevant research papers: one from 2016 on designing tangible affective interaction, and one from 2018 on tangible interaction in the dentist's office. The 2018 paper specifically discusses capturing pain levels for input into a device using tangible interactions.
1. The document reviews two papers by Professor Frode Guribye about developing devices for tangible affective interaction.
2. The first paper proposes using a squeezable stone to allow patients to record emotions in daily life rather than relying on retrospective recall. A prototype was tested with users who found it recorded unique emotional patterns.
3. The second paper applies this work in a dental setting using haptic feedback between dentist and patient to reduce pain. A pilot study found this approach supported communication and comfort during treatment.
This document discusses implementing a web serial API and notes some issues and limitations, including that it has only been tested on MacOS and not Windows. It provides the specification URL and mentions encoder and decoder components but does not provide details on their structure.
The document describes a "Pinch & Play" vocoder project that allows users to modify the sound of their voice by pinching different objects. The system would analyze how pinching an object modifies a user's voice and generate a "voice modulation method" to mimic that effect. The goals are to allow fine-tuning of accent, texture, and tone, and to potentially visualize the sound modifications. Milestones include developing a mimicking voice by October, adding generative modeling by November, and fine-tuning the system and adding visualization by December. Challenges include fine-tuning the modifications and enabling synesthesia through visualization.
This document contains links to various pages about ballistic separators, screens, classifiers and related technologies. It includes Korean and German language links to product pages and case studies for equipment from companies like W. Stadler, Sesotec and ACI Chemical. The technologies covered separate materials by properties like size, weight and shape using air classification, screening, vibration and other methods.
The document discusses a robot programming team launched at Pinocchio in 2014 with goals of developing a cloud compiler called Pino_Com, a motion capture bot (MCB) using a motion capture system to command a humanoid robot, and a first software project. It seeks an interested team member for robot-software and explains the need for cloud compilers and wireless communication between devices and the cloud.
2. Ch9. 인체 감지 애플리케이션 만들기
1. CNN 모델 개요
2. Ch9 Overview
3. Test & Build
Ch10. 인체 감지 모델 훈련하기
3. CNN 모델 개요
기존 이미지 인식 방법
2차원으로 된 이미지를 1차원 배열로 바꾼 뒤
Fully Connected 신경망을 학습시키는 방법
> 이미지의 특성을 이해하지 못하는 단점이 있었음
> 회전이나 움직이면 잘 인식하지 못하는 Overfitting 문제가 있었
음
Convolution(합성곱)을 통해 이미지 특징(Feature) 추출
Ch9. 인체 감지 애플리케이션 만들기
Reference: https://gruuuuu.github.io/machine-learning/cnn-doc/#
4. CNN 모델 개요
Convolution(합성곱)은 한참 전 이미지에 사용된 개념.
Feature의 획득이 가능한 유명한 Filter를 통해 학습하던 방식에서
신경망을 통해 Filter를 생성하고
적합한 필터를 생성해 학습에 이용
Ch9. 인체 감지 애플리케이션 만들기
Reference: https://gruuuuu.github.io/machine-learning/cnn-doc/#
sobel-x sobel-y
5. Ch9 Overview
훈련된 인체 감지 모델(MobileNet 아키텍처)로 MCU에서 예측하
는 법
Architecture
MobileNet https://arxiv.org/pdf/1704.04861.pdf
Training dataset
Visual Wake Words dataset https://arxiv.org/pdf/1906.05721.pdf
그외, “CIFAR10” 도 Cortex-M7에 활용된 기록 있음.
Ch9. 인체 감지 애플리케이션 만들기
10개 클래스, 6만장, 32x32 컬러 이미
지
115k 개의 COCO dataset에서 기원, 비전센서를 통해 사람의 유무 판단 필요성에서
시작.
모델이 250KB 이내를 차지하도록, 사람의 유무 Labeling
가벼운 CNN Architecture을 목표해서 제안. 성능과 효율성의 Trade-off를 맞출 필요성에서 출발.
커널의 변경을 통해 파라미터량을 줄이는 방법(Depthwise Separable Convolution)
Reference: https://minimin2.tistory.com/42
6. Ch9 Overview
Ch9. 인체 감지 애플리케이션 만들기
데이터 전처리 없이 진행
> 학습모델(MobileNet) 때문
(Ch7 호출어감지와 다르게)
모델의 평균을 구하지 않음.
여전히 데이터량이 많아 느림.
인체 감지 어플리케이션의 구성 요소
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples/person_detection
7. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-Main_functions.cc
-Image_provider.cc
모델에 필요한 Op 추가
Tensor_arena 사이즈 정의. (실험적으로 획득된 값)
모델 매핑
모델을 실행할 인터프리터 빌드
8. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-Main_functions.cc
-Image_provider.cc
Input 속성 ASSERT
모델 실행
이미지를 input용 메모리로 복사
Output 속성 ASSERT
9. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-Main_functions.cc
-Image_provider.cc
결과값 획득
사람이 없는 이미지로, 추론
10. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-Main_functions.cc
-Image_provider.cc
image_data 배열의 포인터를 이용한다.
11. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-main_functions.cc
-Image_provider.cc
필요 포인터 선언
모델 매핑
12. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-main_functions.cc
-Image_provider.cc
사용할 Op 추가
작업 메모리 할당
(Cont...) 작업 메모리 할당, setup 종료
13. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-main_functions.cc
-Image_provider.cc
이미지 전달, 추론, 결과 출력
14. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-main_functions.cc
-Image_provider.cc
이미지 전달, 추론, 결과 출력
15. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-person_detection_test.cc
-Image_provider_test.cc
-main_functions.cc
-Image_provider.cc
Sparkfun Edge 보드
frame 포인터에 이미지 저장
input->data.uint8 로 이미지 접근
16. Ch9 Test & Build
Ch9. 인체 감지 애플리케이션 만들기
-HM01B0 카메라 모듈은 320*320 픽셀 이미지 센서 모듈
- 바이너리 빌드
$ make –f tensorflow/lite/micro/tools/make/Makefile TARGET=sparkfun_edge person_detection_bin
- 파일 존재 확인
$ test –f tensorflow/lite/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/person_detection.bin
&& echo “success” || echo “missing”
- 바이너리 서명 및 플래시는 생략하겠습니다 …
18. Ch10 개발 환경 설정
Ch10. 인체 감지 모델 훈련하기
- AWS, Azure, GCP 등, 개발환경 선택 후 진행
- “초소형 머신러닝 TinyML”에서는 GCP를 이용한 예시
- 트러블슈팅 관련 이슈
- 단순 실습 외의 조사한 내용 공유
> slim 에 대해서 알아보기
> (Ch10.10) 아키텍처 이해
19. Ch10. tf-slim
Ch10. 인체 감지 모델 훈련하기
- TF-slim
- 사전에 학습된 모델 제공
- Alexnet
5 conv + 5 pooling
고화질 이미지
- Inception
적은 파라미터수(연산)+정확도
- Overfeat
- Resnet
shortcut connection
파라미터 감소
- VGG
ImageNet (1M)
https://github.com/google-research/tf-slim
20. Ch10. tf-slim
Ch10. 인체 감지 모델 훈련하기
- TF-slim
- Tensorflow의 확장된 추상화 라이브러리,
(추상화는 모두 CNN에 관한 함수를 가독성 좋게 제공..)
- 교재에는 커맨드 arguments로 훈련하지만
실제로 더 많은 모델을 직접 만들어 볼 수 있다.
!python models/research/slim/train_image_classifier.py
--train_dir=vww_96_grayscale
--dataset_name=visualwakewords
--dataset_split_name=train
--model_name=mobilenet_v1_025
…
https://github.com/google-research/tf-slim
제게는 대중화(?) 가능한 모델을 제공하는 정도로 보입
니다.
21. Ch10.10 아키텍처 이해
Ch10. 인체 감지 모델 훈련하기
- MobileNet
- 적은 파라미터, 적은 연산량
- Ver1, Ver2의 비교표를 보면 Ver2가 더 좋아보이지만
- Ver1가 가장 적은 양의 램을 이용한다.
(교재 내용이라서 믿어보지만… 이를 확인해보고 싶었지만…)
- MACs (Multiply-accumulate operations)
http://machinethink.net/blog/mobilenet-v2/
23. Ch10.10 아키텍처 이해
Ch10. 인체 감지 모델 훈련하기
- 14 Depth-wise layer
- Point-wise conv layer
https://www.slideshare.net/ssuser6135a1/ss-106656779
일반적인 Convolution Filter는 입력 영상
모든 채널의 영향을 받게 되는데,
Depth-wise Convolution은 각 단일 채널
에 대해서만 수행되는 필터들을 사용한
다.
24. Ch10.10 아키텍처 이해
Ch10. 인체 감지 모델 훈련하기
- 14 Depth-wise layer
- Point-wise conv layer
https://www.slideshare.net/ssuser6135a1/ss-106656779
커널 크기가 1x1로 고정된 conv layer.
입력 영상에 대한 Spatial feature의 추출은 하
지 않은 상태로, 연산만을 수행.
불필요한 채널의 Coefficient를 이용할 수 있음.
25. Ch10.10 아키텍처 이해
Ch10. 인체 감지 모델 훈련하기
https://www.slideshare.net/ssuser6135a1/ss-106656779
26. Ch10.10 아키텍처 이해
Ch10. 인체 감지 모델 훈련하기
https://www.slideshare.net/ssuser6135a1/ss-106656779
전체 채널에 대한 Spatial conv 각 채널별 Spatial conv 이후 Feature별 연산
27. Ch10.10 아키텍처 이해
Ch10. 인체 감지 모델 훈련하기
https://www.slideshare.net/ssuser6135a1/ss-106656779
전체 채널에 대한 Spatial conv 각 채널별 Spatial conv 이후 Feature별 연산