본문 바로가기
인공지능 개발하기/기술 & 논문 리뷰

[논문 읽기] TabNet: Attentive Interpretable Tabular Learning

by 선의공 2025. 5. 10.
반응형

 

논문읽기의 목적 - 내가 직접 읽으면서 생각하고 정리하는 연습

 

읽어 볼 딥러닝 모델은 2020년 Google Cloud AI팀에서 발표한 TabNet입니다

논문: https://arxiv.org/pdf/1908.07442

제 방식대로 막히는 부분은 찾아보며, 의식의 흐름대로 공부를 목적으로 작성하니

전체적으로 정리된 글을 원하셨다면

이 글이 조금은 불친절할 수 있음을 양해 부탁드리겠습니다.

 

 

해당 논문을 선택한 이유?? 

 

1. 회사에서 Tabular 데이터를 많이 다룸.

2. 보통 Kaggle이나 데이콘에서 예측이나 분류 모델에

딥러닝 모델보다는 트리기반 앙상블 ML 모델인 Xgboost, LGBM, Catboost을 많이 사용함.

Image, Text, Audio 모두 딥러닝 모델이 좋은 성능을 내고 있지만 

Tabular에서는 트리기반 앙상블이 왜 딥러닝보다 성능이 좋고 흔히 사용되는지 궁금함.


 

1.  Abstract

 

1-1. interpretable, cannonical Architecture

 

"a novel high-performance and interpretable canonical deep tabular data learning architecture"

초록의 첫줄부터 저자는 TabNet을 이렇게 제안한다고 말합니다.

 

Interpretable Architecture

해석 가능성을 시사하는 모델구조를 말합니다. 

모델링을 할때  입력 데이터를 넣어주면 모델이 뱉어낸 결과나

성능 평가에 대한 판단은 할 수 있어도

모델이 어떻게 해답을 도출하는지에 대해서 완벽히 아키텍쳐를 이해하기가 어렵습니다.

 

모델을 만들 때 모델이 내부적으로 어떻게 문제를 해결하는지?

정확히 인간이 이해하고 답할수 있는 모델을 만들어보자 해서

해당 개념을 고려했습니다.

 

Tabular 모델 같은 경우에는 feature들이 모델에 들어갔을 때

그 안의 아키텍처를 이해할 수 있다면

데이터와 모델 훈련간의 연관성을 이해하고 성능을 끌어올릴 수 있게 할 수 있다라는

Tabnet 모델의 장점을 부각하는 부분 같습니다.

 

 

canonical Architecture

"표준적"이라는 표현입니다.

Tabular의 표준 Architecture가 되겠다라는 의지를 내비친 부분인 듯 합니다.

 

 

"TabNet uses sequential attention to choose which features to reason from at each decision step, enabling interpretability and more efficient learning as the learning capacity is used for the most salient features."

 

sequential attention방식으로 해석가능성을 가능하게 하고,

내부 결정 과정을 추적할 수 있게 설계되어

가장 중요한 특징에 대해서 효율적으로 학습 한다고 합니다.

 

 

1-2 Unlabeled data에 대한 성능 향상

 

"we demonstrate self-supervised learning for tabular data, significantly improving performance when unlabeled data is abundant."

 

 

라벨링이 되지 않은 데이터가 많은 경우 

self-supervised learning을 통해 성능을 향상시킴.

 

자체적으로 기존의 라벨링의 분포를 판별해서 

분포를 따라가도록 학습을 진행해서 Unlabeled Data를 만드는게 아닐까 생각이 됩니다.

생각이 맞는지는 논문을 따라가며 따져보겠습니다.

 

 


 

2. Introduction

서론에서는 다른 이미지나 텍스트, 오디오 분야에서는 DNNs가 좋은 성능을 보이는데

Tabular는 성능을 내지 못하는 이유와

어떻게 하면 해결할 수 있을지를 설명합니다.

 

Tabular는 AI분야에서 가장 일반적인 데이터 타입이지만,

2019년 당시 Kaggle에서는 딥러닝 모델보다 Decision Tree 기반 모델이 대부분 사용되고 있었습니다.

(2024년 작년에도 그랬지만.)

 

여러 자료를 인용해서 Decision Tree모델이 DeepLearning모델보다 좋은 성능을 내는 이유를 말합니다.

 

 

2-1. Tabular 데이터에서 Decision Tree모델이  DL보다 나은 성능을 내는 이유?

 

2-1-1. they are representionally efficient for decision manifolds with approximately hyperplane boundaries which are common in tabular data;

 

manifolds / 출처: https://kh-mo.github.io/notation/2019/03/10/manifold_learning/

 

tabular data에 일반적인 특징의 대략적인 초평면 경계의 결정 manifolds에 효율적임.

Tabular 데이터의 특징을 분석하기에 적합한 모델이라는 건데,

 

"Tablur데이터는 단순한 논리 조건으로 표현이 됨."

예를 들어(단순히 제가 생각한 일반화되지 않은 예제입니다.ㅎ..)

"연봉 1억 이상이면 변호사,의사에 포함"

이 중 "하얀 가운을 입는 사람이면 의사"이다

그러므로 연봉 1억 이상에 하얀 가운을 입는 데이터는 의사이다.

같은 예제의 단순한 분류에 최적화 된게 Decision Tree라는 거죠.

 

2-1-2. they are highly interpretable in their basic form (e.g. by tracking decision nodes) and there are popular post-hoc explainability methods for their ensemble form

 

Decision Tree에서는 의사결정 노드를 추적하므로서 해석 가능성이 높습니다.

즉, 앞서 초록에서 말한 해석 가능성을 아는 것이 딥러닝보다 쉽기 때문에

"데이터와 모델 훈련간의 연관성을 이해하고 성능을 끌어올릴 수 있게 할 수 있다"를 

실현할 수 있는 장점이 있다는 것 같네요.

 

2-1-3. they are fast to train.

 

훈련이 빠르다고 합니다. 딥러닝은 노드간 복잡한 연결이 많기 때문에

속도 측면에서도 DT가 우세합니다.

 

 

2-2. 또한, 기존의 DNN 구조는 tabular data에 적합하지 않음

 

the lack of appropriate inductive bias often causes them to fail to find optimal solutions for tabular decision manifolds

기존의 DNN모델들은 inductive bias때문에 tabular data에 적합하지 않다고 합니다.

 

inductive bias란

CNN이라면 공간적인 패턴을 학습하는 특성,

RNN이라면 순차적인 데이터의 패턴을 학습하는 특성인데

Tabular의 패턴을 학습하는데에 MLP을 사용하면 매개변수가 많아지고

불필요하게 복잡한 모델을 만들게 되나 보네요.

 

 

아래는 저자가 주장하는 딥러닝이 발휘할 수 있는 이점입니다.

 

 

2-3. 딥러닝의 이점.

 

1. efficiently encoding multiple data types like images along with tabular data;

 

Tabular 데이터에 이미지 데이터가 속해있는 등

multiple data가 있다면 효율적으로 인코딩 할 수 있음

 

2. alleviating the need for feature engineering, which is currently a key aspect in tree-based tabular data learning methods;

 

feature engineering의 필요성을 완화함

어떤 변수가 중요한지 넣고 뺀다던지의

통계학적 데이터 처리의 필요성을 완화함

 

 3. learning from streaming data and perhaps most importantly end-to-end models allow representation learning which enables many valuable application scenarios including data-efficient domain adaptation, generative modeling, and semi-supervised learning

 

실시간으로 들어오는 데이터. 배치 크기로 잘린 순차적인 데이터를

훈련할 수 있고, (아마 병렬처리에 대한 이점 강조가 아닐지? )

표현 학습의 end-to-end가 가능함.

 

즉, 데이터 전처리를 따로 해줄 것도 없이, 모델이 알아서 중요한 특징 변수를 감지하고

변수 데이터가 부족한 부분은 예측하며

end-to-end로 학습하는 것이 이점이라고 이해됩니다.

 

(전처리나 interpolation 같은 부분을 모델이 자동으로 훈련하며

성능이 좋은 쪽으로 처리를 해준다면 편하겠네요.)

 

 

2-4. Tabnet은 어떻게 구현 함?

 

2-4-1. TabNet inputs raw tabular data without any preprocessing and is trained using gradient descent-based optimization, enabling flexible integration into end-to-end learning.

 

전처리 없는 raw tabular data를 넣어주고,

경사 하강법 기반 Optimization로 훈련해 준다고합니다.

 

2-4-2. TabNet uses sequential attention to choose which features to reason from at each decision step, enabling interpretability and better learning as the learning capacity is used for the most salient features (see Fig. 1). 

(Fig 1.)

 

Sequential Attention 방식을 사용해서 어떤 feature가 의미있는지를 골라냄.

이 방식으로 interpretability가 가능하다고 합니다.

 

 2-4-3. TabNet outperforms or is on par with other tabular learning models on various datasets for classification and regression problems from different domains

TabNet enables two kinds of interpretability: local interpretability that visualizes the importance of features and how they are combined, and global interpretability which quantifies the contribution of each feature to the trained model.

 

위의 방법으로 Classification이나 regression 문제에서 

이전 성능이 좋았던 tabular 모델들에 비해 

비슷하거나 뛰어난 성능을 보임.

또한, 로컬적이나 글로벌적으로 interpretability를 제공함.

 

local interpretability: 개별 입력에 대해 중요한 특징과 이들이 어떻게 조합되는지를 시각화함.

global interpretability:학습된 모델에서 각 특징이 기여하는 정도를 정량적으로 분석함.

 

 

 

2-4-4. Finally, for the first time for tabular data, we show significant performance improvements by using unsupervised pre-training to predict masked features (see Fig. 2).

(Fig 2.)

 

Bert같이 마스킹을 통한 unsupervised pre-training을 적용해서

성능을 크게 향상시킬수 있다고 합니다.

 

 


3. Related work

 

이전 연구를 분석하고 TabNet이 어떤 차별점을 두는지 설명합니다

 

3-1. feature selection

 

Feature selection: Feature selection broadly refers to judiciously picking a subset of features based on their usefulness for prediction.

 

Feature selection은 모델 예측에 대한 유효성을 띄는 특징을 찾아내는 과정입니다.

기법이나 연구의 나열은 아래와 같습니다.

전체 훈련 데이터에 대한 feature Important를 가려내는 Global한 기법으로

Forward selection, Lasso regularization, Instance-wist-feature selection 등의 연구가 있음

개별적인 특성을 선택하는 Instance-wise Feature selection 방식이 있음

 

TabNet employs soft feature selection with controllable sparsity in end-to-end learning – a single model jointly performs feature selection and output mapping, resulting in superior performance with compact representations

 

TabNet은 이들과 다르게 end-to-end로 학습 과정에서

soft feature selector를 사용한다고 합니다.

 

즉 feature selection과 output mapping을 같이 함으로서

간결한 구조와 우수한 성능을 강조하는 듯합니다.

 

 

3-2. Tree-based-learning

 

DTs are commonly-used for tabular data learning. Their prominent strength is efficient picking of global features with the most statistical information gain

 

Dicision Tree의 이야기입니다.

Tabular 학습에 가장 일반적인 기법입니다.

강점으로는 information gain을 기반으로 중요한 특성들을 선택합니다.

 2-1-1. 에서의 의사를 판별하는 모델의 방식으로요.

 

분산을 줄이기 위한(편향되지 않게) 앙상블 기법을 사용하는 방식을 많이 사용하며,

Random Forests, XGBoost, LightGBM등의 방식이 있습니다.

 

Our experimental results for various datasets show that tree-based models can be outperformed when the representation capacity is improved with deep learning while retaining their feature selecting property.

 

TabNet의 실험 결과 feature selection 능력을 유지하며을 Representation capacity(표현 능력?)을

딥러닝으로 개선할 경우 성능이 좋아진다고 말합니다.

 

 

3-3. Integration of DNNs into DTs

 

DNN과 Decision Tree방식의 결합된 연구에 대해서 설명합니다.

다양한 DNN안에서 DT를 모방하거나 결합하는 방식을 설명하는데,

 

예를들면 feature selection 부분은 DNN이 진행하며,

학습은 gradient-boosted DT로 전이하며 진행하는 방법 등이 있습니다.

 

TabNet differs from these as it embeds soft feature selection with controllable sparsity via sequential attention.

 

TabNet은? Sequential attention을 통한 제어 가능 희소성을 갖는

soft feature selection을 내재화한다고 합니다.

 

학습 시마다 중요한 특성만 선택하고 배제해서 학습하는게 아닌, 

각 특성에 대한 중요도를 주고(soft feature selection)

attention구조로 어떤 feature가 중요한지를 파악한다고 합니다.

 

3-4. Self-supervised learning

 

Unsupervised representation learning improves supervised learning especially in small data regime

 

작은(적은?) 데이터 환경에서 비지도 학습을 이용해서 지도학습의 성능을 향상시킬 수 있다고 합니다.

 

Recent work for text and image data has shown significant advances – driven by the judicious choice of the unsupervised learning objective (masked input prediction) and attention-based deep learning.

 

근거는?

-근래(2018~2019) 텍스트나 이미지에서 masked input prediction을 이용한

attention-based deep learning이라는 비지도 학습을 이용한 attention 방식을 적용해서

좋은 성과를 냈던 사례가 있었음-

 


 

4. TabNet for Tabular Learning

 

TabNet의 학습에 대한 설명입니다.

 

 

With a specific design, conventional DNN building blocks can be used to implement DT-like output manifold, e.g. see Fig. 3).

 그림 3의 구조로 DT와 유사한 출력 구조를 구현할 수 있다고 합니다.

 

 

4- 1. DNN으로 만든 DT와 유사한 출력 구조

(fig 3.)

Figure 3: Illustration of DT-like classification using conventional DNN blocks (left) and the corresponding decision manifold (right). Relevant features are selected by using multiplicative sparse masks on inputs. The selected features are linearly transformed, and after a bias addition (to represent boundaries) ReLU performs region selection by zeroing the regions. Aggregation of multiple regions is based on addition. As C1 and C2 get larger, the decision boundary gets sharper.

 

그림3에 대한 설명입니다.

왼쪽은 DNN의 구조고, 오른쪽은 매핑된 decision manifold 입니다.

그림에 대해서 단계별로 이해해보겠습니다.

 

- 왼쪽  DNN 구조 그림 -

1. 관련 특성들은 input단에서 multiplicative한 방식의 mask를 통해 하나씩 선택됨.

2. Wx + b 의 Fully connected layer를 통과해 선형 변환이 됨.

3. ReLU를 통과해 음수는 0으로 만듦. (mask로 걸러준 다른 특징에 대한 영역을 분리. 즉 각 노드는 하나의 feature의 특성만 학습.)

4. 특성간의 추출된 결과의 취합(agg.)은 덧셈으로 진행

5. C1과 C2의 값이 크다면 decision boundary는 더 뚜렷해짐

 

-우측 결정 경계 manifold  그림 -

왼쪽의 결과는 우측의 manifold 구조를 가짐.

a, d는 특정 임계값임.

a는 x1(특성1)에 대한 임계값이고 d는 x2(특성2)에 대한 임계값임.

즉, 임계값을 트리 구조의 조건이라고 생각한다면, 

a, d에 대한 조건에 따라 분할되는 것이 결정 트리와 유사하게 됨

아래의 사진과 비교해 보면 유사한 걸 확인할 수 있음.

결정 트리 중 Random Forest의 manifolds / 출처: https://woolulu.tistory.com/28

 

 

다시 논문 내용으로 돌아오면 구조를 한번 더 설명하는데 

 

(i) uses sparse instance-wise feature selection learned from data;

1. 데이터로부터 학습된 sparse instance-wise feature selection을 사용

(논문에서는 Mask와 ReLU를 이용한 구조로 instance-wise feature selection을 구현)

 

(ii) constructs a sequential multi-step architecture, where each step contributes to a portion of the decision based on the selected features;

2. a sequential multi-step 구조로 각 step에서 선택된 특징을 기반으로 decision의 일부를 담당. 

(마찬가지로 Mask와 ReLU를 이용해 feature마다의 decision을 담당)

 

(iii) improves the learning capacity via nonlinear processing of the selected features; and

(iv) mimics ensembling via higher dimensions and more steps.

3. 비선형적으로 처리해서 모델 성능 증가시킴 (그림 3에서는 이해하기 쉽게 선형으로 표현했지만, 실제로는 더 복잡한 구조의 비선형 구조임)

4. 많은 step과 고차원 표현으로 앙상블을 모방함.

 

이로서 논문에서는 해당 구조로 Tabular에 강한 DT와 ensembling 구조를 

구현해줬습니다. 

 

 

4- 2. TabNet 아키텍처

 

Figure 4: (a) TabNet encoder, composed of a feature transformer, an attentive transformer and feature masking. A split block divides the processed representation to be used by the attentive transformer of the subsequent step as well as for the overall output. For each step, the feature selection mask provides interpretable information about the model’s functionality, and the masks can be aggregated to obtain global feature important attribution. (b) TabNet decoder, composed of a feature transformer block at each step. (c) A feature transformer block example – 4-layer network is shown, where 2 are shared across all decision steps and 2 are decision step-dependent. Each layer is composed of a fully-connected (FC) layer, BN and GLU nonlinearity. (d) An attentive transformer block example – a single layer mapping is modulated with a prior scale information which aggregates how much each feature has been used before the current decision step. sparsemax (Martins and Astudillo 2016) is used for normalization of the coefficients, resulting in sparse selection of the salient features.

 

 

(a). TabNet의 Encoder의 구조

TabNet의 Encoder, 즉 특징을 추출하는 기능을 하는 단계의 구조는

feature transformer, attentive transformer, feature masking으로 구성됩니다.

우선,split block으로 representation을 나눠줘서 attentive transformer의 입력과 전체 출력 결과에 사용합니다.

이 각 과정으로 feature selection mask는 모델의 기능적 interpretable information을 제공하고, 마스크는 전역 feature 중요 속성으로 집계될 수 있다고 합니다.

 

(b). TabNet의 Decoder의 구조

각 스텝마다 feature transformer block으로 구성됩니다.

 

(c). feature transformer의 구조

예제로 4개의 layer network를 살펴보면

각 스텝은 FC(Fullyconnected) > BN(BatchNorm) > GLU(Gated Linear Unit)으로 구성됩니다.

GLU는 익숙치 않은 개념입니다.

GLU는 GLU(x,W,V,b,c)=(xW+b)σ(xV+c)의 수식을 가집니다.

딥러닝에서의 하나의 유닛이며, 시그모이드를 이용해 

불필요한 정보는 차단하고 중요한 정보만을 다음 레이어로 전달하는 방식으로

주요 특성을 걸러내는 역할을 합니다.

스텝 중 2개는 "shared across all decision step", 2개는 "decision step-dependent" 역할을 한다고 합니다.

"shared across all decision step"은 모든 단계에서 같은 가중치를 사용한다는 의미입니다.

decision step-dependent"은 각 결정 단계마다 다른 가중치를 가집니다. 이는 각 단계에 특화된 처리를 가능하게 합니다.

이로서, 공유 레이어는 모든 결정 단계에서 일관된 기본 특성 변환을 수행하며,

단계별 레이어는 각 결정 단계마다 단계에서 가장 적합한 특성 변환을 적용합니다.

 

(d). attentive transformer block의 구조

예제로 1개의 레이어 구성을 보자면 

FC > BN > "prior scale information" > Sparsemax로 구성되어있습니다.

여기서도 생소한 개념인 "prior scale information"과 "Sparsemax"를 살펴보자면

"prior sclae information"은 현재 decisiob step에서 볼 때

이전 각 특성이 얼마나 사용되었는지에 대한 정보를 담고 있습니다.

이 정보로 현재 단계의 특성 중요도를 조절 할 수 있습니다.

"Sparsemax"는 softmax의 sparse버전입니다.

즉, softmax는 입력에 대해 출력을 확률로 내뱉지만

sparsemax는 중요한 값이 아니라면 0을 출력합니다.

 

We pass the same D-dimensional features f ∈ R^(B×D) to each decision step, where B is the batch size. TabNet’s encoding is based on sequential multi-step processing with Nsteps decision steps. The ith step inputs the processed information from the (i − 1)th step to decide which features to use and outputs the processed feature representation to be aggregated into the overall decision. 

 

논문에서 설명하는 encoder architecture입니다.

figure를 참고해서 따라그려봤습니다.

 

The idea of top-down attention in the sequential form is inspired by its applications in processing visual and text data (Hudson and Manning 2018) and reinforcement learn- ing (Mott et al. 2019) while searching for a small subset of relevant information in high dimensional input.

해당 Sequential 형태에서의 top-down방식은

다수의 입력 중에서 의미가 있는 소수 정보를 찾아내는데에 유리하다고 합니다.

 

4-2-1. Feature selection 설명

Feature selection: We employ a learnable mask M[i] ∈R^(B×D) for soft selection of the salient features

 

 Fature selection의 핵심은 학습가능한 마스크인 듯 합니다.

중요 특성의 soft하게 선택하기 위해서  마스크(M[i])를 사용한다고 합니다.

 

The masking is multiplicative, M[i] · f. We use an attentive transformer (see Fig. 4) to obtain the masks using the processed features from the preceding step, a[i − 1]: M[i] = sparsemax(P[i − 1] · hi(a[i − 1])).

 

마스킹은 마스크 M[i]에 feature를 곱해주는 작업입니다.

attentive transformer를 통해 마스크를 얻고 중요 특성을 마스킹합니다.

Note that PD M[i]b,j = 1. hi is a trainable function, shown in Fig. 4 using a FC layer, followed by BN. 

normalizatio을 통해 모든 마스크의 합이 1이 되도록 정규화해서 확률처럼 어떤 feature가 중요한지 알 수 있습니다.

P[i] is the prior scale term, denoting how much a particular feature has been used previously: P[i] = Qij =1 (γ − M[j]), where γ is a relaxation parameter – when γ = 1, a feature is enforced to be used only at one decision step and as γ increases, more
flexibility is provided to use a feature at multiple decision
steps. 

 

P[i]는 Attentive transform  구조에서 Prior scales의 부분입니다.

이전 step의 마스크들을 누적곱하며,

γ가 1이면, 한 번 선택된 feature는 이후 step에서 다시 선택되지 않도록 강하게 억제되어, 반복 사용을 방지합니다.

(M[j]는 0~1의 값이므로 γ가 1이면 선택된 feature는 값이 작아짐 -> 다음 feature에서 선택되지 않음)

 

 

To further control the sparsity of the selected features, we propose sparsity regularization in the form of entropy (Grandvalet and Bengio 2004), Lsparse = PNsteps PB PD −Mb,j [i] log(Mb,j [i]+ε) , where ε is a i=1 b=1 j =1 Nsteps ·B small number for numerical stability. We add the sparsity regularization to the overall loss, with a coefficient λsparse. Spar- sity provides a favorable inductive bias for datasets where most features are redundant.

 

 λsparse.라는 정규화식을 구성해주었습니다. 로스를 결정하는 식 중 하나의 정규화 식입니다.

해당 식은 가능한 적은 수의 feature이 선택되도록 유도합니다.

 

4-2-2. Feature processing 설명

4-2-1.에서 Feature을 선택하는 방식에 대해서 설명했다면

이번에는 feature 처리방식을 설명합니다.

 

We process the filtered features using a feature transformer (see Fig. 4) and then split for the decision step output and information for the subsequent step, [d[i], a[i]] = fi(M[i] · f), where d[i] ∈ R^(R*Nd) and a[i] ∈ R^(R*Nd) .For parameter-efficient and robust learning with high capacity, a feature transformer should comprise layers that are shared across all decision steps (as the same features are input across different decision steps), as well as decision step-dependent layers.

 

feature transformer를 통과한 후 split을 통해

Attentive transformer에 들어갈 feature 와 현재 스텝의 출력을 나눠줍니다.

 

많은 수용을 할 수 있으면서, robust한 학습을 위해

feature transformer는 모든 step을 공유하는 Layer와 step별 Layer의 값을 모두 포함합니다.

Each FC layer is followed by BN and gated linear unit (GLU) nonlinearity (Dauphin et al. 2016), eventually connected to a normalized residual connection with normalization. Normalization with √ 0.5 helps to stabilize learning by ensuring that the variance throughout the network does not change dramatically (Gehring et al. 2017). For faster training, we use large batch sizes with BN. Thus, except the one applied to the input features, we use ghost BN (Hoffer, Hubara, and Soudry 2017) form, using a virtual batch size BV and momentum mB.

 

각 FC Layer 뒤에는 BN과 GLU가 이어지고, 마지막에는 residual connection으로 결합됩니다.

√0.5로 스케일링을 마지막에 해주는데, 이는 분산이 너무 커지지 않도록 도와줍니다.

feature transformer 구조에서 각각의 BN은 Ghost BN형태라는 가상 미니 배치를 만들어 BN을 수행한다고 합니다.

이는 큰 배치에서의 계산이 느려지거나 큰 자원소모를 방지합니다.

 

Finally, inspired by decision-tree like aggregation as in Fig. 3, we construct the overall decision embedding as dout = PNsteps i=1 ReLU(d[i]). We apply a linear mapping Wfinaldout to get the output mapping.

 

최종적으로 앞서 4- 1. 에서 설명한 decision-tree 유사 구조를 통해서 Decision Embedding을 구성하고

각 출력 결과를 모두 더해 FC를 이용해 선형 변환을 통해 최종 출력을 얻습니다.

 

4-2-3. Interpretability

그래서 해석가능성을 어떻게 확인할 수 있는지?

 

TabNet’s feature selection masks can shed light on the selected features at each step. If Mb,j [i] = 0, then j th feature of the b th sample should have no contribution to the decision. If fi were a linear function, the coefficient Mb,j [i] would correspond to the feature importance of fb,j . Although each decision step employs non-linear processing, their outputs are combined later in a linear way.

만약 M뒤의 처리되는 f함수가 선형이면 마스크의 중요도가 바로 반영되겠지만,

실제로는 f는 비선형이라 마스크로 중요도를 설명할 수 없습니다.

 

We simply propose ηb[i] = PNd c=1 ReLU(db,c[i]) to denote the aggregate decision contribution at i th decision step for the b th sample. Intuitively, if db,c[i] < 0, then all features at i th decision step should have 0 contribution to the overall decision. As its value increases, it plays a higher role in the overall linear combination. Scaling the decision mask at each decision step with ηb[i], we propose the aggregate feature importance mask, Maggb,j = PNsteps i=1 ηb[i]Mb,j [i] .PD j=1 PNsteps i=1 ηb[i]Mb,j [i]. 

 

이 부분을 해결하고 Interpretability을 설명하기 위해서 ηb[i] 수식을 만들어주고, 

agg를 통해 전체 모델이 최종 예측에 있어 feature j를 얼마나 사용했는지를 수치화합니다.

이를 이용해서 수치로서 특성 중요도의 Interpretability가 설명됩니다.

4-2-4. Tabular self-supervised leaning

3-4. 에서 간단히 설명했던, 적은 데이터로 좋은 성능을 내는 학습이 가능하도록 하는 TabNet의 효율적 학습 방식입니다.

 

We propose a decoder architecture to reconstruct tabular features from the TabNet encoded representations.

TabNet에서는 embedding을 feature로 복원하는 디코더 아키텍처를 제안한다고 합니다.

 

The decoder is composed of feature transformers, followed by FC layers at each decision step. The outputs are summed to obtain the reconstructed features. 

 

Decoder는 Encoder구조와 마찬가지로 여러 Decision step으로 구성되어 있고

각 step마다 Feature Transformer와 이후 FC레이어가 붙습니다.

각 step의 출력을 합산(sum)해서 최종적인 복원된 feature를 얻습니다.

 

We propose the task of prediction of missing feature columns from the others. Consider a binary mask S ∈ {0, 1} B×D. The TabNet encoder inputs (1 − S) · ˆf and the decoder outputs the reconstructed features, S · ˆf. We initialize P[0] = (1 − S) in encoder so that the model emphasizes merely on the known features, and the decoder’s last FC layer is multiplied with S to output the unknown features, and the decoder’s last FC layer is multiplied with S to output the unknown features. We consider the reconstruction loss in self-supervised phase: PB b=1 PD j=1 √ (ˆfb,j−fb,j)·Sb,j PB b=1(fb,j−1/B PB b=1 fb,j) 2

 

결측 feature 예측 훈련을 위한 작업에 대한 설명입니다. 0과 1로 구성된 S{0,1}^(B×D) 형태의 이진 마스크를 사용하여

encoder에서는 (1-S)*f , decoder에서는 S*f로 feature를 한쪽에서 가리면 한쪽은 노출되는 구조를 만들어 줍니다.

만약 S = 0 이라면, encoder에서는 feature를 노출하고, 해당 feature를 포함해 representation을 생성하도록 하고

decoder에서는 해당 feature를 가려놓고 representation을 출력 형태로 복원하면서 self-supervised leaning을 진행합니다.

이로서 모델은 일부 feature(missing feature등의 상황)로부터 전체를 유추하는 능력을 배웁니다.

 


5. Experiments

 

We study TabNet in wide range of problems, that contain regression or classification tasks, particularly with published benchmarks. For all datasets, categorical inputs are mapped to a single-dimensional trainable scalar with a learnable embedding and numerical columns are input without and preprocessing. We use standard classification (softmax cross entropy) and regression (mean squared error) loss functions and we train until convergence. Hyperparameters of the TabNet models are optimized on a validation set and listed in Appendix. TabNet performance is not very sensitive to most hyperparameters as shown with ablation studies in Appendix. In Appendix, we also present ablation studies on various design and guidelines on selection of the key hyperparameters. For all experiments we cite, we use the same training, validation and testing data split with the original work. Adam optimization algorithm (Kingma and Ba 2014) and Glorot uniform initialization are used for training of all models.

 

Tablur 데이터에 대한 회귀, 분류를 포함한 다양한 task에 대해서 벤치마크 데이터셋 실험을 진행했습니다.

데이터셋은 categorical입력에 대해서 embedding화해서 훈련이 가능하도록 하며,

numerical 컬럼은 전처리 없이 입력되었다고 합니다.

분류에는 softmax cross entropy,  회귀에는 mean squarded error 손실함수를 사용했습니다.

모델 훈련에 Adam Optimizer와 Glorot uniform initialization를 사용했습니다.

 

 

5-1. Instance-wise Feature Selection

 

Selection of the salient features is crucial for high performance, especially for small datasets. We consider 6 tabular datasets from (Chen et al. 2018) (consisting 10k training samples). The datasets are constructed in such a way that only a subset of the features determine the output. For Syn1- Syn3, salient features are same for all instances (e.g., the

output of Syn2 depends on features X3-X6), and global feature selection, as if the salient features were known, would give high performance. For Syn4-Syn6, salient features are instance dependent (e.g., for Syn4, the output depends on either X1-X2 or X3-X6 depending on the value of X11), which makes global feature selection suboptimal. 

 

Chen et al., 2018에서 가져온 6개의 tabuler데이터인

Syn1~Syn6에 대한 특성 선택 성능 비교입니다. 

해당 데이터에서 Syn1~SYn3는 중요 특성이 모든 인스턴스(Global instance)에 동일(모든 특성이 중요)하며,

Syn4~Syn6는 인스턴스마다 특성의 중요도가 다른 데이터입니다.

이진 분류에 대한 벤치마크 데이터셋이므로 평가지표는 AUC입니다.

TabNet은 Global한 AUC 성능 뿐만 아니라 Syn4~Syn6와 같이 인스턴스 마다 특성 중요도를 처리가 필요한 데이터셋에서도

좋은 성능을 냅니다.

 

5-2. Performance on real-world datasets

 

TabNet은 실세계 분류 데이터셋에 대해서 머신러닝 보다 높은 성능을 달성했습니다.

 

비교적 적은 모델 사이즈로 비교적 우수한 성능을 자랑합니다.

 

5-3. Interpretability

 

특성 중요도에 대한 마스크 훈련 실험을 시각화해서 보여줍니다.

이로서 Interpretability의 성능도 확인할 수가 있습니다.

해당 시각화로 Syn2 dataset에서의 출력은 X3 ~X6 feature에 많이 의존한다는 것을 확인할 수 있습니다.

 

 

 

5-4. Self-supervised learning

 

Table 7 shows that unsupervised pre-training significantly improves performance on the supervised classification task, especially in the regime where the unlabeled dataset is much larger than the labeled dataset. As exemplified in Fig. 7 the model convergence is much faster with unsupervised pretraining. Very fast convergence can be useful for continual learning and domain adaptation.

 

아래 표를 이용해 self-supervised의 성능 향상 결과를 보여줍니다. 

Supervised : 아무 사전학습 없이 지도학습만으로 학습한 경우.

With pre-trianing: self-supervised 사전학습 후 fine-tuning을 수행한 경우.

self-supervised 후의 accuracy가 올라간 것을 확인할 수 있고, 특히나 데이터셋이 적을수록 더욱 효과가 있었습니다.

 

self-supervised는 학습 수렴 속도에도 영향을 미칩니다.

 


6. Conclusions

We have proposed TabNet, a novel deep learning architecture for tabular learning. TabNet uses a sequential attention mechanism to choose a subset of semantically meaningful features to process at each decision step. Instance-wise feature selection enables efficient learning as the model capacity is fully used for the most salient features, and also yields more interpretable decision making via visualization of selection masks. We demonstrate that TabNet outperforms previous work across tabular datasets from different domains. Lastly, we demonstrate significant benefits of unsupervised pre-training for fast adaptation and improved performance.

결론

1. Tabular 형태 데이터 학습을 위한 딥러닝 아키텍처의 제안을 했습니다.

2. decision step에서 처리할 중요 특성 선택에 순차적 attention 방식을 사용했습니다.

3. Instance-wise feature방식을 이용해 중요 특징을 찾아 효율적인 학습이 가능하게 하고, selection mask의 시각화를 이용해서 Interpretabilty를 제공합니다.

4. 다른 Tabuler 연구(모델)보다 우수한 성능을 보입니다.

5. 비지도 사전 훈련으로 빠른 적응, 향상된 성능을 증명합니다.

 

반응형