/AI-dino-game

A Python project that uses a neural network to learn and play the Google Chrome Dino Game.

Primary LanguageJupyter Notebook

AI-DINO-GAME

AI-DINO-GAME is a Python project that utilizes a neural network to play the Google Chrome Dino Game. The neural network is trained to scan the screen and make decisions to control the dino's actions, allowing it to learn and improve its performance over time.

Table of Contents

Getting Started

Prerequisites

Before running the AI-DINO-GAME project, make sure you have the following prerequisites:

  • Python (>=3.11)
  • Libraries listed in requirements.txt

Installation

  1. Clone the repository:

    git clone https://github.com/jsmatias/AI-DINO-GAME.git
  2. Navigate to the project directory:

    cd AI-DINO-GAME
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Use the set-environment.ipynb to dynamically set the region of the screen to be scanned.

  2. Use the main.ipynb to run the main loop with the settings predefined on the step above.

  3. Watch as the neural network learns to play the Dino Game in your Google Chrome browser.

Training

The neural network is trained using a combination of reinforcement learning techniques. The module environment.py takes screen shots, prepare the data, and control the keyboard to interaction with the dino game. The module agent.py contains the neural network and is responsible for the learning process as well as predicting the best actions based on image analysis.

License

This project is licensed under the MIT License.

Acknowledgement

This code was based and adapted from SaralTayal123