Using Deep Reinforcement Learning To Play Atari Space Invaders

My agent playing Atari Space Invaders


  • I was able to teach an RL agent how to play Atari Space Invaders using concepts from both RL and DL.
  • I used OpenAI Gym Retro to create the environment that my agent played in. It’s from an initiative that encouraged DRL design across many different but similar environments.
  • The neural network in this model is used to process frames from the game to understand where objects are and what the agent is doing. It uses 3 convolutional layers and 3 dense (fully-connected) layers to do so.
  • My model trained for 10k steps (~4 hrs) and played decently, but Google DeepMind recommends training for 10M-40M steps for optimal playing.
  • Here is a video of me explaining the project and watching the agent play.
  • This project was a replicate of Nicholas Renotte’s DRL model.

Model Walkthrough

Creating The Environment

‘NOOP’ is no action.
In general, the agent does okay, but that’s just because it’s taking random actions.

Building The DL Model

  • The number of filters (32). The goal was to train the filters so that they could detect objects in the frames, like the enemies.
  • The size of the filters (8x8 units) and the number of strides.
  • The ReLU activation function and the shape of the frame.

Creating The RL Agent

Training and Testing




15 y/o that loves space, science, tech, and philosophy.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Image Classifier - Cats🐱 vs Dogs🐶

How Google Colab helped me to speed up my video processing tasks while working in remote and had no

Resampling Methods for Data Scientists

Decision Tree Classification

Part-9: Review of Convolutional Neural Network and its Implementation with Tensorflow / Keras

The Hough Transform

Convolutional Neural Networks and how its work

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chloe Wang

Chloe Wang

15 y/o that loves space, science, tech, and philosophy.

More from Medium

Self-Driving Car Using Q-Learning

Implementing multi-armed bandits in reinforcement learning

Deep Q Learning, Monte Carlo Policy Gradients, Actor2Critic: from Conceptual to Math to Tensorflow

Using Reinforcement Learning to play the Snake Game🐍