https://arxiv.org/abs/2111.06449
Expert Human-Level Driving in Gran Turismo Sport Using Deep Reinforcement Learning with Image-based Representation
When humans play virtual racing games, they use visual environmental information on the game screen to understand the rules within the environments. In contrast, a state-of-the-art realistic racing game AI agent that outperforms human players does not use
arxiv.org
Introduction
1. [Baseline; Single-race] “Super-Human Performance in Gran Turismo Sport Using Deep Reinforcement Learning”, Sony AI and RPG in University of Zurich (2021 RA-L)
2. [+ Vision Input] “Expert Human-Level Driving in Gran Turismo Sport Using Deep Reinforcement Learning with Image-based Representation”, Sony AI (2021 NeurIPS)
3. [+ Overtake; Multi-race] “Autonomous Overtaking in Gran Turismo Sport Using Curriculum Reinforcement Learning”, Sony AI and RPG in University of Zurich (2021 ICRA)
4. [Current SOTA] “Outracing Champion Gran Turismo Drivers with Deep Reinforcement Learning”, Sony AI (2022 Nature)
이번 연구는 Sony AI 단독으로 진행되었으며, 이전 포스트 (RA-L) 를 기반으로 GT input data 중 일부를 image로부터 추정하는 방식을 제안하고 있다. (2021 NeurIPS)
Methodology
RL agent 개발의 main goal은 다음과 같다.
Build precise controller using features extracted from game screen images.
Two types of feature representation
기존에 사용되었던 input feature는 GT data를 사용했다. 본 연구에서는 다음의 두 가지 feature를 사용하며, 이를 concatenate하여 policy network의 observation input으로 활용한다.
1. Environment representation (Embedded features from image)
Front camera image로부터 추출하는 feature들은 아래와 같다. (( (D_{env}=27) ))
$$ \mathbf{o}_{env} = \left [ \mathbf{d}_t, l_t^L, l_t^R, e_t, \theta_t, \mathbf{c}_t \right ] \in \mathbb{R}^{D_{env}} $$
$$ \begin{align*} \text{where,} \quad
& l_t^L / l_t^R : \; \text{min. distance from center of car body to left/right edge of track} \\
& e_t : \; \text{lateral error from center of car body to centerline of track}
\end{align*} $$
(나머지 notation은 RA-L 논문 포스트와 동일하다.)
여기서는 HDMI capture 장비를 통해 게임 화면을 60Hz로 저장하여 사용했다. 단일 frame을 사용하고 있기 때문에, 정적 정보들은 비교적 정확하게 추정할 수 있지만, 속도나 가속도와 같은 differential 정보들은 추정이 어렵다. 따라서, 그런 정보들은 아래의 dedicated feature로 묶여서 GT 값을 사용하게 된다.
이런 방법은 꽤나 합리적인데, 실차에 적용한다고 생각했을 때 차량에 존재하는 standard sensor (IMU, 충격 감지 센서 등) 로부터 얻을 수 있는 정보들은 굳이 image로부터 추정할 필요는 없다.
2. Dedicated features (Directly observed data)
직접적으로 GT 정보를 받아 사용하는 feature들은 아래와 같다. (( (D_{ded}=11) ))
$$ \mathbf{o}_{ded} = \left [ \mathbf{v}_t, \dot{\mathbf{v}_t}, \boldsymbol{\gamma}_t, w_t, \delta_{t-1} \right ] \in \mathbb{R}^{D_{ded}} $$
$$ \begin{align*} \text{where,} \quad & \boldsymbol{\gamma}_t \in \mathbb{R}^3 : \; \text{angular velocity in roll/pitch/yaw directions} \end{align*} $$
Training procedure
학습 과정은 다음과 같이 두 개의 phase로 구성된다.
Phase 1 : Image-based representation learning
단일 image ((\mathbf{I})) 에서 ((\mathbf{o}_{env})) 를 추정하는 네트워크를 학습하는 과정이다. Regression task에 해당하며, 두 개의 layer로 구성되어 있다. 사용되는 loss function은 다음과 같다.
$$ \mathcal{L}_{rep} = \left\| \mathbf{o}_{env} - \phi_{reg}(\phi_{rep}(\mathbf{I})) \right\|_2^2 \tag{1} $$
$$ \begin{align*} \text{where,} \quad & \mathbf{I} \in \mathbb{R}^{H \times W \times C} : \; \text{input game screen image} \\ & \phi_{rep} : \mathbb{R}^{H \times W \times C} \to \mathbb{R}^{D_{rep}} : \; \text{embedded representation layer} \\ & \phi_{reg} : \mathbb{R}^{D_{rep}} \to \mathbb{R}^{D_{env}} : \; \text{regression layer} \end{align*} $$
여기서, ((\phi_{rep})) 는 image로부터 embedding vector (( ( D_{rep} = 64 ) )) 를 뽑아낸다. 실제로 dedicated feature와 concatenate되는 vector는 이 64차원의 벡터이며, ((\mathbf{o}_{env})) 보다 더 딥러닝 모델이 해석하기 쉽고 풍부한 embedding 정보를 갖고 있다고 한다.
((\phi_{reg})) 는 ((\phi_{reg})) 에서 나온 output으로부터 ((\mathbf{o}_{env})) 를 추정하는 layer이며, 이 27차원의 벡터와 true value 간 L2 norm 값을 loss function으로 사용한다.
Phase 1을 위한 데이터셋은 offline으로 수집되었다. Built-in GTS AI agent의 control command에 임의의 disrupt를 추가하여 주변 환경에 대한 다양한 image를 수집했다.
GTS의 frame rate는 60Hz로 설정했으며, image data를 real-time으로 다루기 위해서는 inference 수행 시간이 16ms 이내로 들어와야 한다. 이를 위해 space2depth downsampling 기법을 적용하여 depth-wise separable conv.를 수행하는 구조를 채택했고, 약 8ms의 수행 시간을 달성했다고 한다.
Phase 2 : RL using learned representation
RL 모델의 구성은 RA-L 논문의 것과 거의 동일하며, action output의 구성 (throttle/brake, steering) 및 range constraint도 동일하다. Policy network는 아래와 같으며, input으로 75차원의 벡터 ((\mathbf{o}))를 사용한다.
$$ \mathbf{a}_t = \phi_p(\mathbf{o}) \tag{2} $$
$$ \begin{align*} \text{where,} \quad & \mathbf{o} \in \mathbb{R}^{D_{rep} + D_{ded}} : \; \text{concatenated features} \\ & \phi_p : \mathbb{R}^{D_{rep} + D_{ded}} \to \mathbb{R}^{2} : \; \text{policy network} \end{align*} $$
Agent의 goal 또한 마찬가지로 lap time을 minimize하는 것이며, 동일한 reward를 사용한다.
$$ r_t = r_t^{prog}-\left\{\begin{matrix} c_w \left\|\mathbf{v}_t \right\|^2 & \text{if in contact with wall} \\
0 & \text{otherwise} \\ \end{matrix}\right. \tag{3} $$
Experiments
Settings
여기서는 RA-L 논문의 실험 setting 중 'setting B'에 해당하는 Tokyo expressway central outer loop 트랙과 Mazda Demio XD Turing '15 차량을 사용하였다. RL agent의 성능은 Polyphony Digital Inc.에서 제공하는 약 28,000 명의 human player data와 비교되었다.
Training details - Phase 1
Phase 1의 represenation learning 에서는 50 lap 동안 주행하여 취득한 약 630,000개 image가 사용되었으며, 각 image는 1270 x 720의 해상도로 저장되어 실제로 model input으로 사용될 때는 470 x 280의 해상도로 downsampling 되었다.
전방 트랙의 곡률 preview 값은 RA-L과 달리 거리를 고정하여 추정되었다. 이전에는 GT 값을 사용했기 때문에 차속과 어느 정도 비례하여 1.0~2.8s 의 preview를 가졌지만, 여기서는 single image를 사용하기 때문에 40~120m의 고정된 preview를 가지고 10개 지점을 sampling 했다.
Training details - Phase 2
Phase 2의 RL agent learning 에서는 우선 feature concatenate 과정이 수행된다. Embedded env. feature와 dedicated feature가 합쳐지는데, 이 때 image 데이터가 capture 장비의 특성 상 게임에서 직접적으로 받아오는 데이터보다 delay가 발생될 수 밖에 없다고 한다. 결과적으로, 약 4 frame (67ms)의 delay된 정보가 합쳐지며 input으로 사용된다.
Policy network의 경우 두 개의 256-dim. fully connected layer + ReLU layer 로 구성된다. 학습 데이터 취득을 위해 4개의 PS4를 병렬적으로 돌렸으며, 각 PS4마다 20개의 차량이 주행했다. 하지만 screen image는 한 차량 밖에 취득할 수 없기 때문에 20개의 차량 중 한 개만을 sampling 했다.
Results
Lap time comparison
모든 정보를 GT 값으로 사용하는 RA-L 논문의 결과보다 빠르지는 못하지만, 실차에 적용했을 때 가능한 구성으로 input을 설정했다는 관점에서에서 보면, human driver 기록의 10% 이내에 들어왔다는 것은 충분히 유의미한 결과라고 생각된다.
Learned driving behavior
학습 과정에서 차량이 충돌 시, 감속할 뿐만 아니라 control 전체에 disruption을 부여하면서 진행했다고 한다. 학습이 완료된 vision-based controller는 충돌 없이 smooth한 sub-optimal trajectory를 나타냈다.