Skip to content

Python machine learning library for Super Mario Kart

Notifications You must be signed in to change notification settings

Ashafix/NeuroMario

Repository files navigation

NeuroMario

NeuroMario is a Python machine learning module for a self-driving, self-learning AI playing Super Mario Kart on a SNES emulator.

With a very limited input (5 human runs with 5 rounds each, ~10 min of training data), a neural net based on Nvidia's self-driving car publication [1] was trained and able to drive autonomously. The AI has only access to the images produced by the emulator and not internal values such as position or speed. Using SciPy Differential Evolution optimization strategy [2] the neural net was optimized to achieve run times which were superior to the training data.

Inititial model from TensorFlow Best result from self-learning

Additional requirements:

Other features include:

  • Automatic detection of passing the finish line (based on a Random Decision Forest taking a screenshot as the input)
  • Reading run times from screen shots (based on a Support Vector Machine)
  • Parallelization of the learning possible
  • Client-server structure, AI can be run a separate machine

The module was written for Super Mario Kart but most functions are applicable to other SNES games as well.

Architecture

References:

1: Bojarski et al.: End to End Learning for Self-Driving Cars, https://arxiv.org/abs/1604.07316
see also: https://github.com/kevinhughes27/TensorKart and https://github.com/0bserver07/Nvidia-Autopilot-Keras
2: https://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.optimize.differential_evolution.html

Usage

Start python3 NeuroMario.py to get a list of command line options

e.g.

python3 NeuroMario.py play --model model_normalize_nomirror_bitarray_epochs100_tanh_categorical_crossentropy_MarioCircuitIGhostValleyI

Releases

No releases published

Packages

No packages published