/DinoRL

A Reinforcement Learning project that trains a Double Deep Q-Network to excel in the Chrome Dino Game by dodging obstacles and maximizing its score through iterative learning.

Primary LanguageJupyter NotebookMIT LicenseMIT

Applying Reinforcement Learning for the Chorme Dino Run Game

Python JavaScript CSS3 HTML5 License

Dino_non-birthday_version

Table of Contents

About

A Reinforcement Learning project that trains various Double Deep Q-Networks (DDQN) to excel in the Chrome Dino Game by dodging obstacles and maximizing its score through iterative learning.

Team members:

Implementation of the DDQN

The diagram illustrates the architecture of the DDQN. The agent receives a stack of 4 images (80x80 pixels each) representing the last states and uses its Q-Network to predict Q-values for possible actions ("Do nothing" or "Jump"). Based on these Q-values, the agent selects an action and interacts with the environment, resulting in a new state and reward. RL (4) (1)

Training Results

score_chart reward_chart loss_chart

Test Results

The chart compares the maximum scores reached by different variants in a random environment for 20 test rounds. Variants 1 (Blue), 2 (Orange), and 3 (Green) also surpassed the baseline (Grey), with Variant 3 (Green) performing slightly better than Variants 1 and 2. max

Getting Started

Prerequisites

  • Python 3.8 or higher
  • Google Chrome-Browser

Installation

  1. Clone the repository:

    git clone EmreYY20/DinoRL
    
  2. Navigate to the project directory:

    cd DinoRL
    
  3. Install the required Python libraries:

    pip install -r requirements.txt
    

Usage

  1. Start localhost with:

    python -m http.server 8000
  2. Run the code by selecting a config file. In the config file select if you want to train or test:

    python main.py -c config/config1

    To the run the baseline:

    python baseline/main_modified.py -c config/baseline_config

After training, a tfevents-file is created in the runs folder which can be openend using TensorBoard.

License

This project is licensed under the MIT License - see the License file for details.