* 1D 시계열 신호에 Data Augmentation 을 진행한 연구논문을 간단하게 리뷰합니다.
* 웨어러블 가속도 신호와 뇌전도 신호에 대한 논문 3편을 준비했습니다.
* 광주과학기술원 인공지능 스터디 A-GIST 모임에서 발표했습니다.
* 발표 영상 (한국어, 유튜브): https://youtu.be/NpUMFKaDCU4
1. Data Augmentation (for 1D 시계열 데이터)
- Wearable Inertial Signal & EEG Signal –
2018. 12. 04.
Donghyeon Kim
(dhkim518@gist.ac.kr)
2. 1D 시간열 신호에 대한 Data Augmentation 관련 논문 소개
1) 웨어러블 센서 데이터 (가속도 신호)
• T. T. Um et al., “Data augmentation of wearable sensor data for parkinson’s disease monitoring using
convolutional neural networks,” in Proceedings of the 19th ACM International Conference on
Multimodal Interaction, ser. ICMI 2017. New York, NY, USA: ACM, 2017, pp. 216–220.
2) 뇌파 데이터
• Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory
activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
• 고원준, 전은진, 석흥일, 조건부 적대적 생성 신경망을 이용한 동작 상상 기반 뇌-컴퓨터 인터페이스
성능 향상을 위한 뇌 신호 데이터 증대
Contents
2
3. • 사용 가능한 훈련용 Labeled data 가 부족한 경우 훈련 데이터셋 양을 불리자
• 아래 예시: 이미지 처리에서 주로 사용하는 방법들
Data Augmentation
3
http://nmhkahn.github.io/CNN-Practice
https://blog.naver.com/wkjuns/221277796512
https://www.kdnuggets.com/2018/05/data-augmentation-deep-learning-limited-data.html
원본 좌우-상하 반전
Flip
회전
Rotation
줌인/줌아웃
Scale
일부 자르기
Crop
잡음/채도
Jittering
+ Generative Adversarial Networks (GAN)
4. • 데이터 증강 기법은 Small-scale dataset 영역에서 유용하게 사용 할 수 있다
의료 데이터, 웨어러블 데이터 등
• 데이터 증강의 가장 중요하고 어려운 점은 새로운 데이터를 만들어낼 때
기존의 레이블을 유지할 수 있는 domain knowledge를 충족하는 것
뇌파 데이터 샘플들 (X0, X1, X2, …, XK) 순서를
거꾸로 재배치하면 (XK, …, X2, X1, X0) 이 데이터를 뇌파라고 할 수 있을까?
• Vision 영역에서는 많은 데이터 증강 기법들이 연구되어왔지만,
웨어러블 센서 데이터 등 1D 시간열 데이터에 대한 증강 관련 연구는 적다
Vision 영역의 증강 기법을 재해석하여 효과적으로 1D 데이터에 적용하기!
Data Augmentation
4
5. 소개 논문 I
5
T. T. Um et al., “Data augmentation of wearable sensor data for parkinson’s disease monitoring using convolutional neural networks,” in
Proceedings of the 19th ACM International Conference on Multimodal Interaction, ser. ICMI 2017. New York, NY, USA: ACM, 2017, pp. 216–220.
6. • 데이터는 병원에서 특정 동작을 시켜 얻은 데이터가 아니라,
일반 생활(daily-living condition)에서 얻은 데이터이다. 엄청 다양하다.
• 데이터는 육안으로 진단 내리기 어려울 정도로 복잡하다.
• 파킨슨병 환자로부터 수집된 데이터가 너무 적다 (25명)
• 환자마다 증상 패턴이나 분포가 너무 다르다.
해당 환자의 데이터로 학습을 하면 예측이 쉬운데,
다른 환자의 데이터로 학습해서는 generalization이 잘 안된다.
• 데이터가 noisy하고, 심지어 label조차도 부정확한 경우가 많았다.
예를 들면, 몸 전체 증상은 "떨림"인데, 웨어러블을 낀 손만
어딘가를 붙잡고있어 "no signal"이 잡혀 label 불일치가 일어난다.
또는 자발적인 움직임이나 주변의 진동으로 인해 생긴 신호를 취득했을 때,
몸 전체 증상이 떨림으로 보일 수 있다
과제 Challenge
6
논문 및 Terry Taewoong Um 페이스북 게시글 참고
7. • Jittering 잡음 추가하기: A way of simulating additive sensor noise.
해결방법 Method 1
7
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
8. • Scaling 약간의 Magnitude 변화는 label 을 유지할 수도 있다:
Changes the magnitude of the data in a window by multiplying by a random scalar
해결방법 Method 2
8
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
9. • Magnitude Warping 약간의 Magnitude 변화는 label 을 유지할 수도 있다:
changes the magnitude of each sample by convolving the data window with a
smooth curve varying around one
해결방법 Method 3
9
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
10. • Magnitude Warping 약간의 Magnitude 변화는 label 을 유지할 수도 있다:
changes the magnitude of each sample by convolving the data window with a
smooth curve varying around one
해결방법 Method 3
10
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
11. • Magnitude Warping 약간의 Magnitude 변화는 label 을 유지할 수도 있다:
changes the magnitude of each sample by convolving the data window with a
smooth curve varying around one
해결방법 Method 3
11
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
12. • Magnitude Warping 약간의 Magnitude 변화는 label 을 유지할 수도 있다:
changes the magnitude of each sample by convolving the data window with a
smooth curve varying around one
해결방법 Method 3
12
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
13. • Time Warping 약간의 행동 시점 변화는 label 을 유지할 수도 있다:
Smoothly distorting the time intervals between samples to change the temporal
locations of the samples
해결방법 Method 4
13
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
14. • Time Warping 약간의 행동 시점 변화는 label 을 유지할 수도 있다:
Smoothly distorting the time intervals between samples to change the temporal
locations of the samples
해결방법 Method 4
14
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
15. • Time Warping 약간의 행동 시점 변화는 label 을 유지할 수도 있다:
Smoothly distorting the time intervals between samples to change the temporal
locations of the samples
해결방법 Method 4
15
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
16. • Rotation 웨어러블 센서의 착용 방향이 바뀔 수 있다:
Upside-down placement of the sensor can invert the sign of the sensor readings
해결방법 Method 5
16
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
17. • Permutation 약간의 행동 시점 변화는 label 을 유지할 수도 있다:
Randomly perturb the temporal location of within-window events
Slice the data into N same length segments (N ranging from 1 to 5),
and randomly permute the segments to create a new window
해결방법 Method 6
17
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
18. • Permutation 약간의 행동 시점 변화는 label 을 유지할 수도 있다:
Randomly perturb the temporal location of within-window events
Slice the data into N same length segments (N ranging from 1 to 5),
and randomly permute the segments to create a new window
해결방법 Method 6
18
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
19. • Permutation 약간의 행동 시점 변화는 label 을 유지할 수도 있다:
Randomly perturb the temporal location of within-window events
Slice the data into N same length segments (N ranging from 1 to 5),
and randomly permute the segments to create a new window
해결방법 Method 6
19
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
20. • Cropping 센서 신호 취득이 갑자기 끊길 수도 있다
해결방법 Method 7
20
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
21. • Combinations 앞서 적용한 기법들이 함께 혼재 될 수도 있다
해결방법 Method 8
21
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
22. • 파킨슨병 환자 30명의 데이터 수집 (데이터 분석에는 25명 사용)
• 특정 움직임 task 없이 일상생활에서 Microsoft Band 2 착용
• 매 1분의 window 마다 labelling
• Bradykinesia: 운동이 비정상적으로 느림. 육체/ 정신적 반응이 둔함.
• Dyskinesia: 운동 장애. 떨림 증상.
• 총 3530 min (58.8 hours) 데이터 사용
• 5-fold cross-validation (25명의 환자를 5 그룹으로 만듦)
• Note that no other preprocessing, e.g., data normalization or smoothing, is applied
실험 환경
22
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
23. • 일반적으로 CNN이 Fully-connected LSTM보다 적은 파라미터를 사용한다.
• Deep & Sparse 7-layer CNN 사용
• Strided convolutions: 4*1, 4*1, 3*1, 3*3, 2*3, 2*3, 2*3 convolution filters
• XYZ signals of the accelerometer are convolved in layers 4,5,6 and 7 to capture
inter-vector-component features.
• For reducing the number of parameters for small-scale datasets, a global averaging
pooling (GAP) layer is applied at the end instead of fully-connected layers.
CNN 네트워크 구조
23
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
24. • Rotation, Permutation, Time Warping 의 조합이 가장 좋은 성능을 냈다.
• Rotation은 센서의 부착 방향이나, 팔의 포즈에 따른 신호의 다양성(variability)을
상쇄시켜준다.
• Permutation은 1분 크기의 신호를 random N segment로 나눠 그 순서를 랜덤하게
바꿔주는 방법인데, 이를 통해 "증상은 1분 중 어디에도 나타날 수 있음"을 간략하게
재현했다.
• Time Warping은 행동의 시간적 왜곡을 통해 증상이 빠르거나 느리게 나타나는 현상
을 보완해주었다.
결과 Results
24
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
25. • Rotation, Permutation, Time Warping 의 조합이 가장 좋은 성능을 냈다.
• Rotation은 센서의 부착 방향이나, 팔의 포즈에 따른 신호의 다양성(variability)을
상쇄시켜준다.
• Permutation은 1분 크기의 신호를 random N segment로 나눠 그 순서를 랜덤하게
바꿔주는 방법인데, 이를 통해 "증상은 1분 중 어디에도 나타날 수 있음"을 간략하게
재현했다.
• Time Warping은 행동의 시간적 왜곡을 통해 증상이 빠르거나 느리게 나타나는 현상
을 보완해주었다.
결과 Results
25
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
26. • 아직 가장 거대 클래스인 "정상인 상태"를 포함시키지 못했다
• 정상인 상태의 웨어러블 신호는 그 크기가 imbalance하게 크고, 워낙 다양한 활동을
포함하고 있기 때문에 거대한 블랙홀로서 모든 레이블을 빨아들인다.
(large variability due to various activities)
• 궁금한 점
• Data augmentation 기법을 통해 얼마나 많은 데이터 셋을 충원했을까?
• Vision 등 다른 분야에서는 일반적으로 얼마나 데이터를 더 추가해서 학습할까?
한계 Limitations
26
• 논문 및 Terry Taewoong Um 페이스북 게시글 참고
• https://github.com/terryum/Data-Augmentation-For-Wearable-Sensor-Data/blob/master/Example_DataAugmentation_TimeseriesData.ipynb
27. 소개 논문 II
27
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
28. • Fabien Lotte 논문에서 인공 데이터 생성(ADG)과 관련된 부분만 발췌
• 본 논문에서는 BCI Calibration time을 줄이기 위한 기법 중 하나로 ADG를 소개
• The idea is to generate multiple trials from the few training trials available
in order to increase the training set size.
• ADG for EEG trials 세 가지 방법을 소개
1) signal segmentation and recombination in the time domain
2) signal segmentation and recombination in the time-frequency domain
3) using analogies.
* Note that all three methods are applied on the already band-pass filtered EEG signals.
Artificial Data Generation
28
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
29. • Signal Segmentation and Recombination in Time Domain
• 주어진 뇌 신호를 일정한 시간적 간격으로 분할한 뒤 재조합
• 문제점: 부적절한 매칭 및 원하지 않은 고주파 대역 신호 조합 가능성
EEG ADG 방법 1
29
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
F. Lotte, ‘‘Generating artificial EEG signals to reduce BCI calibration time,’’ in Proc. 5th Int. Brain-Computer Interface Conf., 2011, pp. 176–179.
30. • Signal Segmentation and Recombination in Time-Frequency Domain
• 주어진 뇌 신호를 주파수-시간 형태로 변환한 후 일정한 크기로 분할 한 뒤 재조합
EEG ADG 방법 2
30
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
31. • Artificial Trial Generation Based on Analogy
• 주어진 뇌 신호들 중 임의로 두 세트(A, B)를 선택하여 세기의 비율을 계산하고,
그 비율을 다른 신호(C)에 곱해 새로운 인공 신호(D) 생성
EEG ADG 방법 3
31
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
32. • 각각의 방법에 대해 100 개의 인공 데이터를 만들고 훈련 데이터 추가
• 기존 연구에서 100개 이상의 인공 데이터는 통계적으로 유의미한 성능 향상이 없었음
실험 결과 1
32
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
F. Lotte, ‘‘Generating artificial EEG signals to reduce BCI calibration time,’’ in Proc. 5th Int. Brain-Computer Interface Conf., 2011, pp. 176–179.
33. • 공통공간패턴 (Common Spatial Pattern, CSP) 비교
실험 결과 2
33
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
34. • 공통공간패턴 (CSP) 특징을 2차원으로 표현
• 왼쪽: CSP feature 1 vs. 6, 가운데: CSP feature 2 vs. 5, 오른쪽: CSP feature 3 vs. 4
실험 결과 3
34
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
35. • 공통공간패턴 (CSP) 에 대한 LDA 분류기의 weight 값 분석
실험 결과 4
35
Lotte, F. (2015). Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain–computer interfaces. Proceedings of the IEEE, 103(6), 871-890.
37. • 뇌파를 이용한 동작 상상 (Motor Imagery) – 왼쪽/ 오른쪽
• 문제점
Training 과정을 위한 시간 소모가 크고,
피험자도 실험 하는 동안 계속 집중하기가 힘들다
데이터 품질 문제
기계학습 알고리즘의 학습이 어려움
• 기존의 데이터 증대 방법: 슬라이딩 윈도우 (Sliding window)
• 제안하고자 하는 방법:
Conditional Generative Adversarial Network (C-GAN) 기반의 뇌파 데이터 증대
서론 및 연구 배경
37
38. • 조건부 적대적 생성 신경망 (C-GAN)
• 조건: 왼손/ 오른손에 대한 동작 상상의 레이블
• 생성기 (Generator) - deconvolution neural network 사용
• 판별기 (Discriminator) - convolution neural network 사용
• Deep Convolutional Generative Adversarial Nets (DCGAN) 제작의 규칙을 따랐지만,
생성기의 마지막 층에 평균 풀링 (average pooling) 연산을 추가함으로서
저역 통과 필터와 같은 효과를 내도록 구성
• 신경망 목적 함수
G: 생성기 신경망, G(*): 생성기를 거쳐 나오는 생성된 뇌 신호
D: 판별기 신경망, D(*): 판별기에 입력된 데이터가 실제인지 인공인지에 대한 확률
x: 입력되는 실제 뇌 신호
z: 가우스 분포를 따르는 잡음
y: 입력되는 뇌 신호의 클래스 (왼쪽/ 오른쪽)
제안하는 방법
38
39. • 슬라이딩 윈도우
• C-GAN 학습을 위한 데이터 다량 필요
• T 단위 시간의 뇌신호 데이터를 t (<T)
단위 시간의 윈도우로 폭 s로 움직여 추출
• 소프트 레이블
• T 단위 시간동안 피험자가 계속해서
동작 상상에 집중했는지 장담 못함
• T 단위 시간의 원래 학습데이터로 분류기
설계하고, t 단위 시간 데이터를 테스트
(1) 잘못 판단한 데이터 제거
(2) 신뢰도가 0.75 이하의 데이터 제거
제안하는 방법
39
40. • 데이터셋: Berlin Brain-Computer Interface Competition IV-IIa 데이터셋
• 9명의 피험자
• 4개의 클래스 (왼손, 오른손, 발, 혀) 왼손, 오른손 2 class 데이터만 사용
• 250 Hz 샘플링 주파수
• 22 전극 채널
• 전처리, 특징 추출 및 분류기 설계
• 5-30 Hz 에 해당하는 뮤, 베타 대역 주파수 필터링
• 슬라이딩 윈도우, 소프트 레이블 기법을 적용해서 선별된 데이터로 C-GAN 학습하고
생성된 뇌 신호를 분류 알고리즘 학습 데이터로 추가하여 성능 평가
• 특징 추출 기법으로는 공통 공간 패턴 (Common Spatial Pattern, CSP) 사용
• 분류기는 선형 판별 분석 (Linear Discrimination Analysis, LDA) 사용
실험 환경
40
41. • 왼쪽 동작 상상에 대한 C4 채널의 실제 뇌 신호와 생성된 뇌 신호 비교
• 선별적으로 좋은 결과를 고른 것이 아닌, 무작위로 추출된 그림
정성적 평가
41
42. • 상황 1: 실제 학습데이터의 12.5%, 25%, 50% 만 사용하여 학습 시 성능
• 상황 2: C-GAN으로 생성한 뇌 신호 데이터를 실제 학습 데이터 수만큼 추가하여
학습하였을 때의 성능
정량적 평가
42