Playing Flappy Bird Based on Motion Recognition Using a Transformer Model and LIDAR Sensor

Sensors (Basel). 2024 Mar 16;24(6):1905. doi: 10.3390/s24061905.

Abstract

A transformer neural network is employed in the present study to predict Q-values in a simulated environment using reinforcement learning techniques. The goal is to teach an agent to navigate and excel in the Flappy Bird game, which became a popular model for control in machine learning approaches. Unlike most top existing approaches that use the game's rendered image as input, our main contribution lies in using sensory input from LIDAR, which is represented by the ray casting method. Specifically, we focus on understanding the temporal context of measurements from a ray casting perspective and optimizing potentially risky behavior by considering the degree of the approach to objects identified as obstacles. The agent learned to use the measurements from ray casting to avoid collisions with obstacles. Our model substantially outperforms related approaches. Going forward, we aim to apply this approach in real-world scenarios.

Keywords: Flappy Bird game; agent control; motion sensors; ray casting; reinforcement learning; robotics; signal processing; time series processing; transformer model.