andrewda / andrewda.github.io

https://dassonville.dev
6 stars 1 forks source link

Create blog post about writing Convolutional Neural Network from scratch #29

Closed andrewda closed 1 year ago

andrewda commented 1 year ago

In the CS 434 course at OSU, I wrote a Convolution Neural Network from scratch using Python and NumPy.

andrewda commented 1 year ago

In the past few years, Convolution Neural Networks (CNNs) have become one of the most powerful and widely used deep learning models. CNNs are used in many applications, from image recognition to natural language processing, and are the backbone of many successful artificial intelligence (AI) systems.

Creating a CNN from scratch can be a daunting task for even experienced programmers. It requires a deep understanding of the mathematics behind deep learning, as well as expertise in programming languages like Python and NumPy. Fortunately, I had the opportunity to develop a custom CNN from the ground up while taking CS 434 – Artificial Intelligence at Oregon State University.

My first step was to fully understand the basics of CNNs, so I read up on the theory behind them, including mathematical concepts such as convolutions and backpropagation. Once I had a good grasp of the fundamentals, I was ready to start coding.

I began by writing a Python script that would create a convolutional layer. This layer would be responsible for extracting features from an input image and feeding them into the next layer of our network. I then wrote code that would generate weights for each neuron in this layer. Next, I wrote code to define how each neuron should compute its output based on the weights and inputs it received. Finally, I wrote code for backpropagation, which is responsible for updating the weights based on how accurate our network’s predictions were.

After completing these steps, I had a fully functioning CNN that could make predictions on input images. To evaluate my model’s accuracy, I tested it on a standard dataset of handwritten digits. The results showed that my model was able to accurately classify each digit with an accuracy rate above 90%.

Overall, it was an incredibly rewarding experience to develop my own custom CNN from scratch using Python and NumPy. Not only did it give me an in-depth understanding of convolutional neural networks but it also allowed me to practice my programming skills and gain an appreciation for how complex AI systems are built.