이 글은 이활석님의 'AutoEncoder의 모든 것'에 대한 강의 자료를 바탕으로 학습을 하며 정리한 문서입니다. https://youtu.be/o_peo6U7IRM
[Steve-Lee's Deep Insight:티스토리] https://deepinsight.tistory.com/126 내용을 참고하였습니다.
AutoEncoder란?
Manifold Learning
Manifold란 고차원 데이터를 데이터 공간에 뿌리면 sample들을 잘 아우르는 subspace가 있을 것이라는 가정에서 학습을 진행하는 방법 데이터의 차원을 축소시킬 수 있다.
Manifold Learning 은 언제 사용?
- Data Compression
- Data Visualization
- Curse of dimensionality
- Discovering most important features
Curse of dimensionality
- 데이터의 차원이 증가할수록 해당 공간의 부피는 기하급수적으로 증가
- 동일한 개수의 데이터의 밀도는 차원이 증가할수록 희박해진다.
- 차원이 증가할수록 데이터 분포 분석 또는 모델 추정에 필요한 샘플 데이터의 개수가 기하급수적으로 증가
Manifold의 가정
- 고차원의 데이터는 밀도가 낮지만 이를 포함하는 저차원의 Manifold가 있다.
- 저차원의 Manifold를 벗어나는 순간 밀도는 급격히 낮아진다.
- 고차원의 데이터를 잘 표현하는 manifold를 통해 우리는 샘플 데이터의 특징을 파악할 수 있다.
- 고차원 데이터의 manifold 좌표들을 조정해보면 manifold의 변화에 따라 학습 데이터도 유의미하게 조금씩 변하는 것을 확인할 수 있다. (ex. 해상도, 모양, 회전 등등)
- Data Sample을 잘 아우르는 manifold를 찾게 되면 어떤 효과?
- feature를 잘 찾았기 때문에 manifold의 좌표를 조금씩 변경해가면서 데이터를 유의미하게 조금씩 변화시킬 수 있다.
- Data(sample)의 dominant한 feature를 잘 찾았기 때문
- 역으로 manifold를 잘 찾았다면 dominant feature가 유사한 sample들을 찾아볼 수 있다.
AutoEncoder란 무엇인가
- Manifold Learning
- 입력과 출력이 같은 구조
- Bottleneck Hiddenlayer
- Bottleneck layer는 다음과 같이 표현
- Latent Variable(어떤 중요한 의미가 잠재)
- Feature(특징)
- Hidden representation
AutoEncoder의 수식과 학습 방법
- 수식
- input Data를 Encoder Network에 통과시켜 압축된 z값을 얻는다.
- 압축된 z vector로부터 input data와 같은 크기의 출력 값을 생성한다.
- 이때 Loss값은 입력값 x와 Decoder를 통과한 y값의 차이이다.
- 학습방법
- Decoder Network를 통과한 Output layer의 출력 값은 Input 값의 크기와 같아야 한다.
- 이때 학습을 위해서는 출력 값과 입력 값이 같아져야 한다.
AutoEncoder 학습 후 얻을 수 있는 직관
- Encoder 관점
- 적어도(최소한) input data를 잘 복원한다.
- 최소한의 성능을 보장
- Decoder 관점
- 최소한 training data를 만들어 줄 수 있다.
AutoEncoder 활용 예시
- AutoEncoder는 실제로 Input Data의 feature를 추출할 때 많이 사용
- 주로 Dimension Reduction에 사용
- Network parameter 초기화, pre-training에 많이 사용
- 이 때는 Batch-Norm, Xavier Initialization과 같은 기법들이 많이 없었음
Stacking AutoEncoder for pre-training
어떻게 하면 AutoEncoder를 잘 학습시킬 수 있을까?
AutoEncoder는 (Training DB에 있는) Input data에 대해서는 적어도 복원을 잘하는 특징이 있다. 따라서 이러한 특징을 활용해 Training DB에 있는 Input data를 잘 표현하는 weight를 학습 할 수 있다.
왼쪽은 학습에 사용할 AutoEncoder, 오른쪽은 pre-training을 위해 weight을 학습하는 과정
- (Training DB)에 있는 Input data를 잘 표현하는 1번째 Layer의 1000개의 weight를 가진 layer를 지나 다시 input data를 복원하는 과정에서 데이터의 특징을 가지고 있는 weight을 학습
- 다음 레이어의 weight을 학습하려면 어떻게 할까? 레이어의 weight을 복원하는 AutoEncoder를 구성하여 Input data를 잘 표현하는 weight을 학습할 수 있게 된다.
- 동일한 방식으로 마지막 레이어의 weight도 학습을 할 수 있다.
- 이렇게 학습이 끝난 AutoEncoder로 weight를 Initialization을 해주고 모델의 학습을 위해 Backpropagation 하면 된다.
Denoising AutoEncoder
Denoising AutoEncoder에서는 input data에 random noise를 추가한다.
이때 random noise라 하면 사람이 데이터에 대해 같다고 생각할 만큼의 noise를 추가하는 것이다. 이런 noise를 추가하더라도 manifold 상에서는 똑같은 곳에 분포된다는 가정이 있다.
즉, manifold상에서는 똑같지만 원본 데이터와는 다른 데이터로 Encoder와 Decoder를 학습하는 네트워크를 Denoising AutoEncoder라고 한다.
Denoising AutoEncoder의 성능
Denoising AutoEncoder를 보면 AutoEncoder에 비해 Filter가 Edge를 더 잘 탐지하는 모습을 보여준다. 이를 통해 Denoising AutoEncoder의 성능이 더 뛰어나다고 볼 수 있다.
'Study' 카테고리의 다른 글
[Study] 선형대수 용어 정리 (0) | 2024.04.20 |
---|---|
AutoEncoder의 모든 것 #3 (0) | 2023.06.06 |
[Study] AutoEncoder의 모든 것 #2 (4) | 2023.06.06 |
[Study] AutoEncoder의 모든 것 #0 (0) | 2023.06.06 |