3 ms·
Show HN: A Convolutional Neural Network Implemented in a Spreadsheet
- kjlubick 5y agoFor a long while, I sort of understood neural networks, but not really - some of the finer details escaped me. For example, I understood convolutions and how they can detect edges (a ala Sobel edge detection), but I didn't understand how a neural network could make use of those and how simple shapes like lines and edges could be built up further. I tried reading a lot of things, but either they were too high level, or overwhelmed me with opaque formulas. Even looking at the source code of others attempts to implement them from scratch (e.g. using NumPy) wasn't clearing my learning hurdle. So, I took a page of advice from a great CS teacher of mine - "If you can build it, you can understand it" (This was the same CS teacher who, in Java 1, had us build an ArrayList and LinkedList from scratch so we understood the differences). I tried building one in a spreadsheet. It took a while to find a problem that had the right scope (detecting cats/dogs = way too hard, NNIST = overdone, letters = just right). Eventually, I succeeded at creating a single layer CNN that could distinguish a T from an X. Fast forward a few hours, and I had a deep CNN that could also handle an L. If you are the type of person who likes to look at the completed LEGO design and figure it out yourself (I'm not), the fully implemented sheet is what I've linked above. Make a copy; then copy the sample data from README to L0:Input. Maybe try playing with convolutions on "Exploring Convolutions". Maybe try adding another feature detector for a letter like M or K. If you are like me and prefer to have a guided tour through the thought process and the design, I've made a companion set of videos that (hopefully) explains the finer details. They also link to an earlier series that starts with building (and training!) a traditional neural network in a spreadsheet, if you are interested. Part 1 - https://www.youtube.com/watch?v=8QfFtUcuYCU https://www.youtube.com/watch?v=8QfFtUcuYCU Part 2 - https://www.youtube.com/watch?v=pH0s0e62GT8 https://www.youtube.com/watch?v=pH0s0e62GT8