Paper link : https://www.semanticscholar.org/paper/InAction%3A-Interpretable-Action-Decision-Making-for-Jing-Xia/3944b9b00b69761c56d647e7425eea87e6e78cab
https://www.semanticscholar.org/paper/InAction%3A-Interpretable-Action-Decision-Making-for-Jing-Xia/3944b9b00b69761c56d647e7425eea87e6e78cab
www.semanticscholar.org
Introduction
지난 포스트에서 소개한 OIA 모델의 후속작으로 InAction 모델이 제안되었다. (2022 ECCV)
OIA 모델의 한계점은 다음과 같다.
- Action 선택에 대한 explanation을 제안했지만, 이러한 reasoning process에 대한 interpretation은 이루어지지 않음.
- 21가지 Explanation을 제시했지만, 이는 모든 가능한 시나리오들을 커버하지 못함.
- Multi-label action decision 결과와 일치되지 않는 모호한 explanation이 도출될 때가 있음.
- Temporal 정보를 무시한 채, 단일 frame만을 사용함.
본 논문에서는 explicit한 explanation 뿐만 아니라 implicit한 해석 방법을 함께 적용하여 reasoning 과정을 강화하였고, video 형태의 image sequence input을 사용하여 temporal 정보를 활용했다.
InAction 모델의 contribution은 다음과 같다.
- Implicit visual semantic과 explicit human annotation 관점 모두 적용한 interpretable reasoning framework를 제안함.
- Implicit 모듈과 explicit 모듈을 서로의 한계점을 상호 보완하며 action decision 성능을 향상시킴.
- 기존 모델들과 비교했을 때, action decision-making 과정에 있어 transparency와 interpretability가 향상됨.
Proposed Framework
Architecture Overview
Fig. 1은 제안된 프레임워크의 전체 architecture이다. Convolutional backbone (( G(\cdot) )), 그리고 두 개의 action prediction 모듈 (explicit, implicit)로 구성되어 있으며, 여기서 implicit visual-semantic 모듈을 (( G_S(\cdot) ))로 표시하도록 하겠다.
Implicit 모듈에서는 각 frame 별 feature map을 받고 학습된 semantic prototype을 visual cue로 활용하여 action-inducing local region을 발견한다.
Explicit 모듈에서는 global visual feature와 implicit 모듈에서 구한 local feature를 concatenate하여 multi-task classifier로 넘긴다. 이 때, driving action을 예측하는 모듈을 (( C_R(\cdot) )), human-annotated explanation을 예측하는 모듈을 (( F_R(\cdot) ))으로 표시하도록 하겠다.
마지막으로, 학습된 prototypical visual cue들과 예측된 human-annotated explanation을 함께 사용하여 FC layer (( C_S(\cdot) ))을 통과하고, temporal attention layer가 부여한 각 frame 별 contribution을 고려하여 최종 action 예측 결과가 output으로 나오게 된다.
논문에서 사용된 notation을 추가적으로 정리하면 다음과 같다.
- Input video w/ (( m )) frames : (( \mathbf{X}=\left\{\mathbf{x}_i \right\}_{i=1}^{m} ))
- Action label : (( \mathbf{y}_a \in \mathbf{A} )), (( C_{act} = \left| \mathbf{A} \right| ))
- Human-annotated explanation : (( \mathbf{y}_c \in \mathbf{E} )), (( C_{exp} = \left| \mathbf{E} \right| ))
- Feature map : (( \mathbf{f}_i = G(\mathbf{x}_i) \in \mathbb{R}^{H\times W\times D} ))
- Patches (in the feature map) : (( \mathbf{Z}_{\mathbf{x}_i} = \left\{\mathbf{z}_k \in \mathbf{f}_i \right\}_{k=1}^{HW} )) , where (( \mathbf{z}_k \in \mathbb{R}^{D\times 1\times 1} ))
Implicit Visual Semantic Interpretation
Visual input으로부터 action-inducing local region을 찾아내기 위해 다음과 같이 각 action class (( k ))마다 (( m_k ))개의 semantic prototype을 할당한다. 그 다음, 이전 단에서 구한 patches (( \mathbf{Z}_{\mathbf{x}_i} ))와 prototype (( \mathbf{p}_j ))을 사용하여 activation score를 계산한다.
- Visual semantic prototype : (( \mathbf{P}=\left\{\mathbf{P}_l \right\}_{l=1}^{\left|C_{act} \right|} )) , where (( \mathbf{P}_l = \left\{\mathbf{p}_j \right\}_{j=1}^{m_k} ))
- Activation score : (( s_{kj}=\log\left(\frac{\left\| \mathbf{z}_k - \mathbf{p}_j \right\| ^ 2 + 1}{\left\| \mathbf{z}_k - \mathbf{p}_j \right\| ^ 2 + \epsilon } \right ) ))
- Activation feature set : (( \mathbf{M}_{\mathbf{x}_i} = \left\{\mathbf{M}_{\mathbf{x}_i}^{r} \right\}_{r=1}^{m} ))
- Activation heat map : (( \mathbf{M}_{\mathbf{x}_i}^{r} =\left\{s_{kj}\right\}_{k=1}^{HW}.\text{reshape}(H, W) \in \mathbb{R}^{H\times W} ))
이 논문에서 설명하기로, action decision을 내리는데 가장 중요한 patch는 각 action 카테고리에 대해 유사하게 존재하는 semantic을 중심으로 cluster되어야 하고, 서로 다른 action 카테고리의 prototype을 중심으로 하는 cluster는 잘 분리되어 있어야 한다. 이런 관점에서 다음의 discriminative prototype learning loss를 적용했다.
Objective : Shapes the latent space into a semantically meaningful clustering structure.
$$ \mathcal{L}_d = \lambda_1 \mathbb{E}_{\mathbf{x}_i \in \mathbf{X}} \min_{\mathbf{p}_j \in \mathbf{P}_{\mathbf{y}_a}} \min_{\mathbf{z} \in \mathbf{Z}_{\mathbf{x}_i}} \left\|\mathbf{z}-\mathbf{p}_j \right\|^2 - \lambda_2 \mathbb{E}_{\mathbf{x}_i \in \mathbf{X}} \min_{\mathbf{p}_j \notin \mathbf{P}_{\mathbf{y}_a}} \min_{\mathbf{z} \in \mathbf{Z}_{\mathbf{x}_i}} \left\|\mathbf{z}-\mathbf{p}_j \right\|^2 \tag{2}$$
여기서 (( \lambda_1 ))과 (( \lambda_2 ))는 두 loss term의 기여도를 결정하는 hyper-paramter이다. (( \mathcal{L}_d ))를 최소화하는 과정은 모든 input frame에 대해 자신의 action에 해당하는 latent feature map patch들 중 강하게 활성화된 prototype이 적어도 한 개 이상 존재하는 동시에, 다른 action class의 patch 및 prototype과의 latent space 상 거리를 최대화한다.
Explicit Human-annotated Reasoning
Implicit 모듈과는 달리, explicit 모듈은 비교적 더 intuitive하고 abstract된 방식으로 reasoning을 진행한다. 일반적으로, NL annotation들은 temporal과 spatial 정보를 모두 포함하고 있으며, global scene에 대한 이해와 action-inducing object들에 대한 설명을 담고 있다.
본 논문에서는 feature map에서 prototype 중 어느 하나라도 활성화시킨 patch들 중 activation score가 높은 top-(( N )) patch들을 골라 action-inducing local component, (( \mathbf{Z}_{local} = \left\{ \mathbf{z}_o \right\}_{o=1}^N )) , where (( \mathbf{z}_o \in \mathbf{Z}_{\mathbf{x}_i} )) 로 정의한다.
이렇게 선정된 (( N ))개의 patch들은 human-annotated object들 뿐만 아니라, 다양한 scene context, environmental information 등을 제공한다는 점에서 기존 OIA 모델의 한계점을 해결했다.
Global feature map은 visual input에 대한 전체적인 정보, i.e. environment status (e.g. "Road is clear"), agent relationship (e.g. "There's vehicle parking on the right") 를 제공한다. Local action-inducing 성분들이 global 정보와 concatenate되어 action predictor (( C_R(\cdot) ))와 human-annotated explanation predictor (( F_R(\cdot) ))의 input으로 활용된다.
구체적으로, global feature map (( \mathbf{Z}_{\mathbf{x}_i} ))은 global average pooling 과정을 거쳐 global feature vector (( \mathbf{Z}_{global} ))로 변환된다. 이후 local-global fused feature (( \mathbf{Z}_{g\oplus l}=\left\{\mathbf{z}_o \oplus \mathbf{z}_{global} \right\}_{o=1}^{N} ))를 구하고, vectorize 과정을 거친 다음 action-explnation prediction 모듈의 input으로 활용된다. 각 예측결과는 (( \mathbf{\hat{y}}_a^{R} )), (( \mathbf{\hat{y}}_e^{R} ))로 표현하도록 하겠다.
Explicit prediction task는 다음의 두 가지로 분류될 수 있으며, 아래의 multi-task learning object를 사용한다.
$$ \mathcal{L}_r = L (\mathbf{y}_a,\mathbf{\hat{y}}_a^{R} ) + L (\mathbf{y}_e,\mathbf{\hat{y}}_e^{R} ) \tag{3} $$
- Single-label prediction : (( L(\cdot, \cdot) )) denotes cross-entropy loss
- Multi-label prediction : (( L(\cdot, \cdot) )) denotes binary cross-entropy loss
Interpretable Decision Prediction
지금까지 두 가지 다른 관점의 explanation, i.e. (( \mathbf{M}_{\mathbf{x}_i} ))와 (( \mathbf{\hat{y}}_e^{R} ))을 구했다. 이를 이용하여 concatenated explanation vector (( \mathbf{\hat{y}}_e = \left[ \mathbf{M}_{\mathbf{x}_i}, \mathbf{\hat{y}}_e^{R} \right ] ))를 구하고, FC layer (( C_S(\cdot) ))을 통과하여 action decision (( \mathbf{\hat{y}}_a^S = C_s(\mathbf{\hat{y}}_e) ))을 예측한다.
앞서 explicit 모듈과 동일하게 두 가지 task로 분류될 수 있으며, 아래의 multi-task learning object를 사용한다.
$$ \mathcal{L}_s = L (\mathbf{y}_a,\mathbf{\hat{y}}_a^{S} ) \tag{4} $$
Cross-module Fusion and Temporal Aggregation
지금까지 다음의 두 가지 action decision prediction 결과를 얻었다.
- (( \mathbf{\hat{y}}_a^{R} )) : based on the visual features
- (( \mathbf{\hat{y}}_a^{S} )) : based on explored explicit-and-implicit explanations
이제 이를 이용해 aggregated action prediction (( \mathbf{\hat{y}}_a = \mathbf{\hat{y}}_a^{R} + \mathbf{\hat{y}}_a^{S} ))를 구한다. 전체 모델의 input은 (( m ))개의 frame으로 구성되어 있기 때문에, 최종 action prediction 결과는 (( \{ \mathbf{\hat{y}}_a^1, ... , \mathbf{\hat{y}}_a^m \} )) 형태의 sequence로 구해진다.
Temporal attention layer는 FC layer와 softmax function으로 구성되며, 각 frame (( \mathbf{x}_i )) 마다 importance (( \delta_i ))를 계산한다. 이는 구해진 sequence 중 key frame을 찾는데 활용되며, temporal 정보가 추가된 objective는 다음과 같이 정의된다. 이 과정도 마찬가지로 두 가지 task로 분류될 수 있다.
$$ \mathcal{L}_t = L(\mathbf{y}_a,\sum_{i=1}^{m} \delta_i \mathbf{\hat{y}}_a^{i}) \tag{5} $$
Overall Objective
최종적으로, 모든 optimization objective들을 합해서 unified framework의 objective로 활용한다.
$$ \mathcal{L} = \mathcal{L}_d + \mathcal{L}_r + \mathcal{L}_s + \mathcal{L}_t $$
Experiments
Setup
Pedestrian Situated Intent (PSI) dataset
30fps, 15초 정도의 영상을 110개 포함하고 있는 데이터셋이며, 3가지의 speed change action ("maintain speed", "slow down", "stop")이 frame 단위로 annotation되어 있다. NL explanation도 존재하지만, 기존 BDD-OIA의 annotation 방식과 조금 차이가 있어 후처리 과정을 거친다. 이 데이터셋을 train/validation/test set으로 각각 75%/5%/20%의 비율로 분배했으며, 15개의 frame을 sampling 했을 때 ((( m=15))), 16번째 frame의 action과 explanation을 예측하게 한다.
PSI dataset은 3개의 action 중 1개만이 할당되는 single label task이다. Explanation의 경우 environment context와 human behavior를 포함하고 있는 sentence-based 형태를 갖는데, 일관되어 있지 않기 때문에 다음의 과정을 거쳐 29개의 reasoning 카테고리로 변환한다.
- Environmental context와 human behavior에 대한 설명을 segment 단위로 분리
- Syntactic dependency tree를 적용하여 단어 별 dependency tagging 생성
- Heuristic rule을 적용하여 그룹화 진행
- Pre-trained BERT 모델을 사용하여 모든 segment들에 대한 embedding 생성
- ((k))-means clustering을 적용하여 ((k))개의 semantic categories 도출
Evaluation metric은 다음과 같다.
- Action : Overall prediction accuracy, Class-wise average accuracy
- Explanation : Overall F1 socre, Class-wise mean F1 score
BDD-OIA datset
이 데이터셋은 OIA 논문에서 소개된 내용을 참고하길 바란다. BDD-OIA dataset은 4개의 action 중 여러 개가 할당될 수 있는 multi label task이다. 따라서 evaluation metric으로 action과 explanation 모두 F1 score를 사용한다.
Implementation Details
- Two-stage training :
- First stage : Pre-train Faster R-CNN backbone w/ BDD100K dataset
- Second stage : Train overall InAction model w/ PSI and BDD-OIA dataset
- Implicit module :
- (((1\times1)) conv.)((\times 2)) + (normalize via sigmoid) 통해 feature map channel 감소 (((7\times7\times256 \to 7\times7\times128)))
- ((m_k=6)) w/ dimension 128, i.e. ((m=24)) for BDD-OIA, ((m=18)) for PSI
- ((C_S(\cdot))) : FC layer (1) /w.o bias
- Explicit module :
- ((N=10))
- ((C_R(\cdot)) : FC layer (3) + ReLU
- ((F_R(\cdot)) : FC layer (2) + ReLU
- Adam optimizer w/ initial lr : ((10^{-3})), weight decay by 0.1 every 10 epochs
- Loss parameters : ((\lambda_1=0.1)), ((\lambda_2=0.01))
Comparison Results
PSI dataset에 대한 결과는 Table 2에 나와있다. 여기서, "OIA-global"은 OIA 모델에서 local proposal branch를 제외한 모델을, "Ours-f"는 InAction 모델에서 temporal 정보를 무시한 채 마지막 frame만을 사용한 모델을, 그리고 "Ours-v"는 video input을 사용하여 temporal attention layer를 적용한 모델을 의미한다.
Temporal 정보를 활용했을 때 가장 높은 성능을 보였으며, global feature만을 사용한 "OIA-global"이 4가지 중 가장 낮은 성을 보였다.
BDD-OIA dataset에 대한 결과는 Table 3에 나와있다. 여기서, "OIA*"은 본 논문에서 reproduce한 모델이며, remind 하자면 OIA에서는 RPN을 거쳐 생성된 local feature proposal을 사용했었다. "Ours(proposals)"의 경우, OIA에서 했던 것과 같이 detected proposal을 이용하여 implicit visual semantic prototype들을 학습시킨 것이고, "Ours(global)"의 경우, Fig. 1과 같이 global feature map을 이용하여 학습시킨 것이다.
이 경우도 마찬가지로 OIA 모델보다 InAction 모델이 OIA의 reproduce 버전보다 더 높은 성능을 보였으며, 특히 reasoning 성능에서 더 뚜렷한 성능 향상을 보였다. 이는 explicit 모듈과 implicit 모듈이 상호 작용하며 서로 놓친 부분을 보완했기 때문이라고 주장하고 있다.
Interpretability Analysis
전체적으로 향상된 성능을 보여주며, 3번째 case의 경우 OIA와 InAction 모두 "stop/slow down"이라는 FP prediction 결과를 보였다. 이는 explanation에서 확인할 수 있듯이 전방 차량을 장애물로 봤기 때문이며, image sequence가 아닌 단일 frame만을 사용했기 때문에 생기는 오류라고 주장하고 있다.
Fig. 3은 explicit 모듈과 implicit 모듈 간 상호 보완 작용에 대한 해석을 보여준다. 첫 번째 case의 경우 explicit 모듈에서 오른쪽 차선에 장애물이 있어서 RLC가 불가능하다고 판단했고, implicit semantic prototype visualization 결과를 살펴보면 마찬가지로 오른쪽 차선에 높은 score를 부여하고 있는 것을 확인할 수 있다.
두 번째 case의 경우 GT action 값이 LLC가 가능하다고 말하고 있다. 하지만, image를 보면 알 수 있듯이 왼쪽 차선에 장애물이 존재한다. Human-annotation에서 "Obstacles on the left lane"이 없었더라도, implicit 모듈에서 왼쪽 차선에 높은 score를 부여함으로써 LLC가 불가능하다고 판단할 수 있게 보완해준다.
Fig. 4는 visual semantic prototype들이 특정 action decision category에 대한 의미를 추상화하는데 사용될 수 있도록 학습된다는 것을 직관적으로 보여주는 예시이다. 위에서부터 각각 "stop/slow down", "turn left", "turn right"와 관련된 prototype에 대해 활성화된 patch들을 나타내고 있으며, 각 prototype과 가장 유사한 patch들을 고른 것이다. 그리고 가장 높에 활성화된 부분에 대해 원본 이미지에 bbox를 표시하여 어디를 집중하고 있는지를 보여주고 있다.
적색 신호등, 오른쪽 차량, 왼쪽 차량과 같은 특정 prototype이 implicit 모듈을 통해 input patch 전체를 슬라이딩하며 activation map으로 나타나고, 특정 prototype중 하나가 강하게 활성화된 region은 InAction 모델의 최종 prediction 결과에 큰 영향을 미칠 것으로 예상하고 있다. 사람이 실제 주행을 하면서 action decision을 내릴 때 주로 참고하는 object들과 거의 동일하게 학습되었으며, 직관적으로 의미 있는 prototype임을 확인할 수 있다.
Fig. 5는 InAction 모델의 추론 과정을 시각화한 것이다. 앞서 설명했듯이, input frame에 대해 implicit 모듈은 학습된 prototype과 모든 patch들을 비교하여 activation score map을 계산한다. 우측 상단의 figure는 prototype에 의해 가장 강하게 활성화된 activation map을 나타내고 있다.
각 prototype에 대한 activation score set ((M_{\mathbf{x}_i}))은 (( \mathbf{\hat{y}}_a^{S} ))를 예측하기 위해 FC layer를 통과한다. 이 때, FC layer는 prototype 및 action 별 weight를 가지고 있으며, 아래 두 개의 figure가 이를 나타내고 있다. 해석해보자면 왼쪽 아래의 "forward"에 대한 weight의 경우, "forward"에 해당하는 ((p_5))에 대해서 양의 weight를 주로 가지며, "stop/slow"에 해당하는 ((p_11))에 대해서 음의 weight를 주로 가짐으로써 "forward" action에 대한 probability를 각각 증가, 감소 시킨다.