All Projects → nikp06 → subwAI

nikp06 / subwAI

Licence: MIT license
Scripts for training an AI to play the endless runner Subway Surfers using a supervised machine learning approach by imitation and a convolutional neural network (CNN) for image classification

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to subwAI

Parametric-Contrastive-Learning
Parametric Contrastive Learning (ICCV2021)
Stars: ✭ 155 (+80.23%)
Mutual labels:  supervised-learning, image-classification
Neural Pipeline
Neural networks training pipeline based on PyTorch
Stars: ✭ 315 (+266.28%)
Mutual labels:  supervised-learning, image-classification
Malware Classification
Towards Building an Intelligent Anti-Malware System: A Deep Learning Approach using Support Vector Machine for Malware Classification
Stars: ✭ 88 (+2.33%)
Mutual labels:  supervised-learning, image-classification
EllaTheGame
Ella - The Game
Stars: ✭ 39 (-54.65%)
Mutual labels:  endless-runner
Sign-Recognition
Traffic Sign Recognition with Keras.
Stars: ✭ 19 (-77.91%)
Mutual labels:  image-classification
head-network-distillation
[IEEE Access] "Head Network Distillation: Splitting Distilled Deep Neural Networks for Resource-constrained Edge Computing Systems" and [ACM MobiCom HotEdgeVideo 2019] "Distilled Split Deep Neural Networks for Edge-assisted Real-time Systems"
Stars: ✭ 27 (-68.6%)
Mutual labels:  image-classification
aitlas
AiTLAS implements state-of-the-art AI methods for exploratory and predictive analysis of satellite images.
Stars: ✭ 134 (+55.81%)
Mutual labels:  image-classification
Face.evolve.pytorch
🔥🔥High-Performance Face Recognition Library on PaddlePaddle & PyTorch🔥🔥
Stars: ✭ 2,719 (+3061.63%)
Mutual labels:  supervised-learning
Image-Classification
Pre-trained VGG-Net Model for image classification using tensorflow
Stars: ✭ 29 (-66.28%)
Mutual labels:  image-classification
LibFewShot
LibFewShot: A Comprehensive Library for Few-shot Learning.
Stars: ✭ 629 (+631.4%)
Mutual labels:  image-classification
TensorFlow-Binary-Image-Classification-using-CNN-s
Binary Image Classification in TensorFlow
Stars: ✭ 26 (-69.77%)
Mutual labels:  image-classification
SCL
📄 Spatial Contrastive Learning for Few-Shot Classification (ECML/PKDD 2021).
Stars: ✭ 42 (-51.16%)
Mutual labels:  image-classification
tensorflow-image-classifier
image classifier, retrained for specific classes
Stars: ✭ 58 (-32.56%)
Mutual labels:  image-classification
Pyramidnet
Pytorch implementation of pyramidnet
Stars: ✭ 27 (-68.6%)
Mutual labels:  image-classification
MLclass
My main Machine Learning class
Stars: ✭ 56 (-34.88%)
Mutual labels:  supervised-learning
Data Science Free
Free Resources For Data Science created by Shubham Kumar
Stars: ✭ 232 (+169.77%)
Mutual labels:  supervised-learning
shake-drop pytorch
PyTorch implementation of shake-drop regularization
Stars: ✭ 50 (-41.86%)
Mutual labels:  image-classification
react-native-camera-tflite
Real time image classification with React Native and Tensorflow lite.
Stars: ✭ 52 (-39.53%)
Mutual labels:  image-classification
SimMIM
This is an official implementation for "SimMIM: A Simple Framework for Masked Image Modeling".
Stars: ✭ 717 (+733.72%)
Mutual labels:  image-classification
tensorflow-image-recognition-chrome-extension
Chrome browser extension for using TensorFlow image recognition on web pages
Stars: ✭ 88 (+2.33%)
Mutual labels:  image-classification

About subwAI

subwAI - a project for training an AI to play the endless runner Subway Surfers using a supervised machine learning approach by imitation and a convolutional neural network (CNN) for image classification.

For this project, I made use of a supervised machine learning approach. I provided the ground truth data by playing the game and saving images with the corresponding action that was taken during the respective frame (jump, roll, left, right, noop) and in order for the AI to best imitate my playing style I used a convolutional neural network (CNN) with several layers (convolution, average pooling, dense layer, dropout, output), which gave me a good accuracy of 85% for it's predictions. After augmenting the data (mirroring, which resulted in a dataset twice as big) the model seemed to give even more robust results, when letting it play the game. Ultimately the model managed to finish runs of over a minute regularly and it safely handles the usual obstacles seen in the game. Moreover, the AI - with it's unconvential behavior - discovered a game-changing glitch.

More on all this can be seen in my video on YouTube.

new_thumb

Description/Usage

This repository contains everything that is needed for building an AI that plays Subway Surfers. With the provided scripts you can...

  • build a dataset by playing the game while running py ai.py gather (takes rapid screenshots of the game and saves images in respective folders ['down', 'left', 'noop', 'right', 'up'] in the folder 'images'); press 'q' or 'esc' to quit
  • train the specified model defined in get_model() on existing dataset running py ai.py train; add load <image_width> to use a preloaded dataset for the respective image_width provided it has been saved before
  • augment the existing dataset by flipping every image and adjust the label (flipped image in 'left' needs to be changed to 'right') by running py dataset_augmentation.py
  • have a look at what your trained model is doing under the hood with py image_check.py to see individual predictions for images and change labels when needed (press 'y' to move on to next image; 'n' to delete image; 'w' to move image to 'up'-folder; 'a' to move image to 'left'-folder; 's' to move image to 'down'-folder; 'd' to move image to 'right'-folder)
  • if order of images is changed run py image_sort.py in order to bring everything in order again
  • AND MOST IMPORTANTLY run py ai.py play to let the trained model play the game; press 'q' or 'esc' to quit; press 'y' to save a screen recording after the run and 'n' to not save it; add auto as a command line argument to have the program automatically save recordings of runs longer than 40 seconds

Also...

  • in the folder 'recordings' you can view the saved screen captures and see the predictions for each individual frame as well as the frame rate
  • in the folder 'models' your trained models are saved; while the Sequential() model (convolutional neural network with layers defined in get_model()) gives the best results you can also try other more simplistic machine learning models such as [KNeighborsClassifier(n_neighbors=5), GaussianNB(), Perceptron()]
  • visualizations of the CNN-architecture and details regarding layer configurations as well as the accuracy and loss of the model is saved in models\Sequential

ezgif com-gif-maker

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].