2021년 8월 27일 금요일

[논문 리뷰] 콘크리트 오토인코더(Concrete Autoencoders)

Concrete Auto-encoders for Differentiable Feature Selection and Reconstruction

(Abid, Abubakar et al. “Concrete Autoencoders for Differentiable Feature Selection and Reconstruction.” ICML (2019). https://arxiv.org/abs/1901.09346v2)

 작년에 알게 된 논문이긴 하지만, 근래 들어 오토인코더에 대한 공부를 하면서 좀 더 자세히 살펴본 김에 논문 리뷰를 하게 되었다. 기본적으로 discrete relaxation과 지정된 k개 만큼의 feature selection을 목적으로 한다는 점에서, 내가 활용하고자 하는 용도에 부합한다. (ICML Proceeding이라 조금은 아쉽다.)

Abstract

We introduce the concrete autoencoder, an end-to-end differentiable method for global feature selection, which efficiently identifies a subset of the most informative features and simultaneously learns a neural network to reconstruct the input data from the selected features. Our method is unsupervised, and is based on using a concrete selector layer as the encoder and using a standard neural network as the decoder. During the training phase, the temperature of the concrete selector layer is gradually decreased, which encourages a user-specified number of discrete features to be learned. During test time, the selected features can be used with the decoder network to reconstruct the remaining input features. We evaluate concrete autoencoders on a variety of datasets, where they significantly outperform state-of-theart methods for feature selection and data reconstruction. In particular, on a large-scale gene expression dataset, the concrete autoencoder selects a small subset of genes whose expression levels can be use to impute the expression levels of the remaining genes. In doing so, it improves on the current widely-used expert-curated L1000 landmark genes, potentially reducing measurement costs by 20%. The concrete autoencoder can be implemented by adding just a few lines of code to a standard autoencoder.

 Abstract에서는, CAEs(Concrete Autoencoders)는 end-to-end 방식의 전역 feature selection이 가능한 오토인코더이고, 기본 오토인코더의 인코더 대신 Concrete selector layer를 사용하는 방식이라고 한다. 디코더는 여전히 기본 오토인코더의 것을 사용한다. 구조적으로 기본 오토인코더에서 크게 바뀌는 것이 없기 때문에 적은 코드로도 쉽게 구현가능한 것을 장점으로 내세운다. 기본적으로 Annealing schedule을 활용하는 방식인데, 이것을 simulated annealing이라고 말할 수 있는 것인지는 확인해보아야겠다. 또, 선택된 feature들만 이용하여 test set에 대한 predict 수행이 가능하다고 한다.

1. Introduction

 Feature selection이라는 분야는 고차원 데이터셋을 저차원으로 축소하는 것에 목적을 둔다고 이야기하고 있다. 고차원 데이터셋의 feature가 갖고 있는 redundant한 수준을 측정하는 방식이라고도 한다. 그렇다면, 데이터셋에서 가장 중요한 Feature라는 것은 무엇인가? 아니면, 데이터를 축소하기만 하면 Feature selection인가? 에 대한 질문이 생긴다.

저자는 일반적인 차원축소 문제와 Feature selection의 문제가 엄연히 다름을 명시해두었다. 예를 들어 PCA(주성분분석) 또는 Hinton의 Autoencoder 등의 차원축소 기법들은 물론 데이터를 maximal variance를 유지하거나 또는, reconstruction loss를 최소화하면서도 더 적은 차원에 나타낼 수 있다.

하지만, 이러한 방식들은 오리지널 데이터셋에 존재하는 feature set을 선택하는 것이 아니라, 과잉(redundant)의 feature를 제거하고, 시험적 비용을 감소시키는 것에 목적이 있기 때문에 feature selection과 차원축소 문제는 서로 다르다고 한다.

이들이 이 논문에서 제안하는 CAEs는 discrete relaxation과 Maddison et al.(2016)의 Concrete distribution, 그리고 re-parametrization trick을 활용하여 reconstruction loss를 최소화하는 feature set을 찾는 방식이다.

discrete relaxation 방법으로는 Gumbel-softmax 방법을 활용하며, 이 부분은 후술한다.


2. Problem Formulation

 기본적으로, d-차원의 데이터로부터 발생하는 확률분포 \(p(x)\)가 존재한다고 가정한다. 이 모델이 포커싱하는 대상 자체가 discrete dataset을 이용한 비지도학습에 있다고 하니, 해당 확률분포 \(p(x)\)는 categorical distribution의 \(p_i\)라고 생각해도 좋아 보인다.

 목적은 이 알고리즘 사용자의 목적에 따라 고정된 'k'개 사이즈의 subset인 \(S\subseteq\{1, 2, ... , d\}\)을 학습하는 것과 reconstruction function인 \(f_{\theta}(\cdot)\)를 학습하는 것에 있다. 형태를 살펴보았을 때엔, 이 함수 부분을 디코더로 사용할 것임을 생각할 수 있다. 정리하면 최적화 문제는 다음과 같다. :
\[\arg \min_{S, \theta} E_{p(x)}[||f_{\theta}(x_{s})-x||_{2}]\]

하지만, 현실에서는 확률분포 \(p(x)\)를 알 수 없다 : 대신 \(p(x)\)로부터 i.i.d. 하게 n개의 데이터가 샘플링되었다고 가정한다(결국 추정값을 사용하겠다는 얘기다.)

이 n개의 샘플들은 데이터 행렬 \(X\in\mathbb{R}^{n\times d}\)의 형태로 나타내어질 수 있고, \(X\)로부터 k개 열로만 구성된 sub-matrix \(X_{S}\in\mathbb{R}^{n\times k}\)를 selection 할 수 있다. 또한, \(f_{\theta}(X_{S})\)를 이용해 matrix \(X\)를 복원할 수 있을 것이다. 결국 empirical reconstruction error는 다음과 같다. : 
\[\arg \min_{S, \theta} ||f_{\theta}(X_{S})-X||_{F}\]
(where \(||\cdot||\) denotes Frobenius norm of matrix)

하지만 이 최적화문제는 d-차원에 따라 NP-hard문제가 됨은 자명하기 때문에, back propagation이 불가능하다는 문제점을 야기하므로, 미분가능한 함수를 활용해보는 것으로 실험적 접근을 하겠다고 선언한다.

3. Proposed method

 앞서 언급하였듯이 이들이 제안하는 CAEs는 기본 오토인코더의 변형이며, discrete feature selection을 위한 모델이다. 다만, 기본 AEs에서 fully-connected layer를 encoder로 사용하는 것과 달리 concrete selector layer를 사용한다는 점에서 차이가 난다. 

또한 annealing schedule에 따라 각 layer가 결합되어가는데, (마치 simulated annealing과 같이) layer의 temp \(T\)가 0이 되면, k개 input feature를 선택하게 되는 구조이다.
-> 그렇다면 SA 외에 다른 비선형최적화 기법을 적용하는 것도 가능하지 않을까?

CAEs의 decoder는 reconstuction error function의 역할을 담당하고, 기본 AEs와 구조가 동일하다. : dataset 크기와 복잡도에 맞추어 사용자가 알아서 세팅한다.

결론적으로 제안된 방법은, 임의적으로 복잡한 형태의 reconstruction function을 효과적으로 최적화한다.

3.1 Concrete Selector Layer

 encoder가 되는 Concrete Selector Layer는 Maddison et al.(2016)과 Jang et al.(2016)에서 제안한 Concrete random variable에 그 기초를 둔다. 이 확률 변수를 샘플링함으로서, one-hot vector를 continuous relaxation 할 수 있다. 이 relaxation 과정은 3절에서 annealing schedule과 관련하여 언급한 temperature \(T\in (0,\infty)\)의 통제를 받는다. 

parameter \(\alpha\in\mathbb{R}^{d}\)와 \(T\)를 갖는 Concrete r.v.를 샘플링하기 위해서는, 우선 Gumbel distribution \(g\)에 i.i.d.한 d차원 벡터를 샘플링 해야한다. 이렇게 분포로부터 샘플링 된 \(m_{j}\)는 다음과 같이 정의할 수 있다. :
\[m_{j}= \frac{\exp((\log\alpha_{j}+g_{j})/T)}{\sum_{k=1}^d \exp((\log\alpha_{k}+g_{k})/T)}\]

(where \(m_j\) refers to the \(j^{th}\) element in a particular sample vector.)

temperature \(T\)가 0으로 수렴할수록, concrete r.v.는 이산형 분포에 접근하고, \(m_{j}=1\) with probability \(\alpha_{j}/\sum_{p} \alpha_{p}\)를 결과값으로 갖는다. Kingma & Welling(2013)에서 소개된 re-parametrization trick을 통해 매개변수 \(\alpha\)의 미분을 가능하게 하는것이 Concrete r.v.의 목적이다.

이들은 이러한 목적을 가진 Concrete r.v.을 이용해 다음의 방식으로 input feature selection을 수행한다. Concrete selector layer 전체 k개 노드 각각으로부터 d-차원의 Concrete r.v. \(m^{(i)}, i\in \{1, ... , k\}\)를 샘플링한다. (이 때, \(m^{(i)}\)에서의 i는 노드 인덱스임을 유의한다.)

selector layer 안의 i번째 노드 \(u^{(i)}\)는 \(x\cdot m^{(i)}\)를 결과값으로 내보낼 것이다. 일반적으로 이 값은, input feature의 weighted linear combination으로 볼 수 있으나, \(T\)가 0에 수렴함으로써, 각 노드로부터 concrete selector layer는 단 하나의 input feature만을 결과값으로 갖는다. 네트워크 훈련 이후 테스트에서는, concrete selector layer를 discrete arg max layer로 교체하며, 이 layer는 i번째 뉴런의 결과값으로 \(x_{\arg \max_{j} \alpha_{j}^{(i)}}\)를 갖게된다.


Conclusion

 용법이 적절하여 CAEs를 조만간 작성할 새 논문에서 활용할 예정이다. 실험관련하여서는 논문 리뷰를 하지 않는다. 다만, 유의미한 것은 dataset의 차원이 매우 고차원일 때 사용하거나, bio data와 같이 sequential dataset 형태를 띠는 경우 활용하기 좋다는 점을 부각했다는 것 정도로 정리할 수 있겠다. 
 대체적으로 Gumbel softmax trick에서 크게 벗어나지는 않았지만, 활용 방법에 따라 꾸며내기 좋은 모델을 개발하지 않았나 싶다.

댓글 없음:

댓글 쓰기

[Git] Trailing comma의 용도

 현재 저는 사내에서 개발자 교육을 받고 있습니다. 오늘의 포스팅은 해당 교육 중 과제를 통해 알게 된 Trailing comma에 대한 내용입니다.  2022-04-03, SSG TECH101 과정 중 Git 수업 Title : About Trail...