Skip to content

chesta02/Flappy-Bird-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐦 Flappy Bird AI using Deep Q-Network (DQN)

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.


📌 Project Overview

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.


🚀 Features

  • Deep Q-Network (DQN)
  • Experience Replay
  • Epsilon-Greedy Exploration
  • Neural Network Function Approximation
  • Configurable Hyperparameters (YAML)
  • Training Log Support

🛠️ Tech Stack

  • Python
  • PyTorch
  • Gymnasium
  • Flappy Bird Gymnasium
  • NumPy
  • PyYAML
  • TensorBoard

📂 Project Structure

Flappy-Bird-AI-DQN/
│
├── agent.py
├── dqn.py
├── experience_replay.py
├── game_flappy_bird.py
├── parameters.yaml
├── requirements.txt
├── README.md
└── runs/

⚙️ Installation

Clone the repository

git clone https://github.com/chesta02/Flappy-Bird-AI-DQN.git

Move into the project

cd Flappy-Bird-AI-DQN

Install dependencies

pip install -r requirements.txt

Run training

python game_flappy_bird.py

🧠 Reinforcement Learning Workflow

  1. Initialize the Flappy Bird environment
  2. Observe the current state
  3. Select an action using an epsilon-greedy policy
  4. Receive a reward from the environment
  5. Store experiences in replay memory
  6. Sample mini-batches for training
  7. Update the Deep Q-Network
  8. Repeat until the agent learns an optimal policy

📈 Future Improvements

  • Double DQN
  • Dueling DQN
  • Prioritized Experience Replay
  • PPO Agent
  • Performance Dashboard

About

An AI-powered Flappy Bird agent trained using Deep Q-Network (DQN) reinforcement learning to learn optimal gameplay through trial and error.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages