A neural network which tries to classify your drawing in 4 categories: Fish, hurricanes, mushrooms and rainbows.
This idea was completely stolen from strongly inspired by the Coding Train.
The neural network has a big database of images, these come from Google Quick Draw. Using this giant collection of images, the neural network is trained to classify any new, unseen drawing into one of the 4 categories mentioned earlier.
The neural network used in this project is made by Daniel Shiffman.
It is possible to run this script in the browser. Alternatively, you can download or clone this repository and open index.html. It should work straight away. If you run into any issues, please let me know or create a pull request.
(Note that it is sometimes necessary to run this project on a local server)
If you want to change the code a bit, the following variables are easily changed and can have a significant impact:
-
const total
, found in sketch.js. This variable decides how many images are loaded into memory and used for training. Please note that your browser might run out of memory if this number is too high. Obviously, the time needed to train one generation increases as well. This github repository currently has 2000 images of each category, so if you want to use more you'll need to download them yourself. -
const hidden_nodes
, also found in sketch.js. This variable is responsible for the amount of hidden nodes in the neural network. Increasing this number will also increase the time needed to train one generation, so choose wisely.
- Provide some sort of UI.
- Implement a "keep training" button.
- Make users able to delete parts of their drawing using right click.