Giter VIP home page Giter VIP logo

kgaleziowski / intelligent-garbage-truck Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 106.89 MB

Project of an intelligent autonomous garbage truck that implements most important learning methods in artificial intelligence. Created for Artificial Intelligence classes in the summer semester of 2020/2021 at Adam Mickiewicz University in Poznań with @HondaPl, @SmoothCrimminal and @Maciasty15.

Python 100.00%
astar-algorithm decision-trees garbage-classification genetic-algorithm heuristic-search-algorithms machine-learning neural-network pygame python pytorch state-space-search travelling-salesman-problem

intelligent-garbage-truck's Introduction

Intelligent Garbage Truck

Implementation of intelligent autonomous garbage truck that travels by path with the lowest cost (TSP problem solved with genetic algorithms) from garbage to garbage, collects garbage if circumstances allows to do so (decision trees classification) and recogonizes type of garbage that is in trash (neural network object recognition). Agent uses BFS and A* algorithms implementation for state space searching, agent environment is highly configurable. Agent can turn left, right and move forward by one unit with cost of 1. If he moves through obstacle it has additional cost of 10. Agent with A* algorithm toggled will always consider that cost and with help of genetic algorithms traversal of all trashes will be always close to optimal.


Project contains:

✔️ Agent environment in the form of a tile map generated from a .tmx configuration files

✔️ Agent movement within environment, state space traversal.

✔️ Implementation of state space searching with BFS (Breadth-first search) algorithm

✔️ Implementation of state space searching with heuristic algorithm A* and Manhattan distance.

✔️ Implementation of decision trees for making decision about picking up garbage under current circumstances based on 8 parameters (even/odd day of the week, size of garbage, weight of garbage, paid bill, can/cannot close bin, free space, type of garbage, time of a day), model training, learning set, extracted trainer for model

✔️ Implementation of neural networks for recognizing four different types of garbage (plastic, paper, glass, mixed) based on given picture. Model training with keras using multiple layers and saving it to file.

✔️ Implementation of genetic algorithms for solving traveling salesman problem: cost matrix generation, chromosome adjustment to environment, mutations, elitism, crossover, ranking, mating pool, all parameters can be easily changed (population size, elite size, mutation rate, number of generations), generation of plot for cost optimision obtained by genetic algorithms.

✔️ Clear HUD that shows what is happening in the agent's environment at the moment (including picture of garbage).

✔️ Dataset containing nearly 1000 pictures of each type of garbage (plastic, paper, glass, mixed)

✔️ Access to configuration files which allows to play with generated environment


Video demonstration (autonomus mode):

Just press space after opening application

Autonomus.mp4

Video demonstration (free mode):

Select location with left mouse click and then:

  • Press O to place obstacle
  • Press T to place trash
  • Press A to change state space searching algorithm
  • Press S to save current map configuration (location of obstacles, trashes) - more information at the end of this file
  • Use right click on location to make garbage truck drive to this location by road found using currently selected algorithm (you can compare difference between A* and BFS in that way in very nice way with obstacles)
Free.mp4


This video shows that agent chooses longer road if it has lower overall cost but there is much more to check - try it yourself!


Agent environment:

s1

s2

s3


Dataset samples (examples of glass/paper/plastic/mix):

glass (20)

paper (131)

plastic (13)

mix (648)


Genetic algorithms plot visualization of cost optimisation (different parameters):

PLOT-003

PLOT-002

PLOT-004

PLOT-008


Technology stack:

  • Python Programming Language

  • PyGame library

  • Keras library

  • PyTorch library

  • Sklearn library

Requirements:

1. Install Python 3.x (version 3.9 is recommended)

2. Install pygame library

3. Install numpy library

4. Install torch library

5. Install tensorflow (version 2.8.0) library

6. Install torchvision library

7. Install pytmx library

8. Install scikit-learn library

9. Open project ("intelligent-garbage-truck-main" folder) under PyCharm IDE

10. Run main.py

11. Press space when after everything is loaded

‼️ If any library is missing, just install it according to the information returned by ModuleNotFoundError. ‼️


Additional features:

✔️ User can load multiple configurations in settings.py file and also create his own configurations according to instructions in file "GA-How to use.txt".

✔️ User can easily change used algorithm for state space searching by pressing A key (A*/BFS).

✔️ User can analyse optimise obtained by genetic algorithms by checking plots generated in configurations folder 001, 002, etc.

✔️ All important information is logged in real time to the console and can be verified.

intelligent-garbage-truck's People

Contributors

kgaleziowski avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.