A reinforcement learning project where an AI agent learns to play Flappy Bird using the Deep Q-Network (DQN) algorithm. The agent improves its gameplay by interacting with the environment, storing experiences, and optimizing its policy through neural network training.
This project implements Deep Q-Network (DQN), one of the most popular reinforcement learning algorithms, to train an autonomous Flappy Bird agent.
Instead of manually programming the bird's behavior, the agent learns from rewards and penalties while playing thousands of games.
- Deep Q-Network (DQN)
- Experience Replay
- Epsilon-Greedy Exploration
- Neural Network Function Approximation
- Configurable Hyperparameters (YAML)
- Training Log Support
- Python
- PyTorch
- Gymnasium
- Flappy Bird Gymnasium
- NumPy
- PyYAML
- TensorBoard
Flappy-Bird-AI-DQN/
│
├── agent.py
├── dqn.py
├── experience_replay.py
├── game_flappy_bird.py
├── parameters.yaml
├── requirements.txt
├── README.md
└── runs/
Clone the repository
git clone https://github.com/chesta02/Flappy-Bird-AI-DQN.gitMove into the project
cd Flappy-Bird-AI-DQNInstall dependencies
pip install -r requirements.txtRun training
python game_flappy_bird.py- Initialize the Flappy Bird environment
- Observe the current state
- Select an action using an epsilon-greedy policy
- Receive a reward from the environment
- Store experiences in replay memory
- Sample mini-batches for training
- Update the Deep Q-Network
- Repeat until the agent learns an optimal policy
- Double DQN
- Dueling DQN
- Prioritized Experience Replay
- PPO Agent
- Performance Dashboard