Creating a Number Detecting Neural Network | Roblox CNNs | W.I.P

Hello Wonderful People!! ;]

In this topic i’ll be sharing the progress on a Convolutional Neural Network i’m currently working on.
The topic will be expanded as i develop new functionalities and stumble upon things I think are worth sharing!


Concept Library 📖

Anything written [like this] will be explained in here.`

Kernels 🏋️‍♂️

Kernels are grids with weights, used to calculate the importance that a data value has to a specific neuron. They’re who make everything work, since they are responsible to manipulate the given data.

They are also used in convolution to find paterns among the grid’s values.

But all of their funcionalities are only possible thanks to the learning process, that alter their values depending on how well the output represents the desired value.


Pooling 🏊‍♀️

Pooling is a technique which involves convoluting trough an image and reducing it’s size, while maintaining the important data.

This is done by checking every value in the grid and outputting the bigger one.

It is usualy done using a 2x2 grid, and is realy useful to speed things up! :stopwatch:

Take a look!

:sparkles:If you spot something you don’t know about, feel free to ask me to put it up in here!


What's a CNN? 👈

CNN stands for Convolutional Neural Network. It is used to process information in images, videos, and anything that makes sense when put into a grid.

It works by convoluting through the data grid, which is, going step by step with a weight grid called a [Kernel], multiplying the values in the grid to detect patterns.

There is more to it than just that, but that’s the most important part about CNNs. We’ll see the rest soon!



Current Progress :star:

I’ve been working at this for about 18 hours now, and i managed to do a lot!

I’ve scripted a basic canvas, and a function that takes the drawn image, transforms it into a table, and convolute it. Then another function plots it into a second canvas.

Here’s the result!

I also made a [Pooling] function to resume the data for the next [Layers]

Here’s pooling in action!

By stacking another convolution and another pooling layer we already have the raw result of the network.

But there’s a lot yet to be done! This is just a base for the complex structure that is a neural network. Lots of things might change, or be fixed until we get the final results, but that’s just how it goes ;]


What’s Yet to be Done? :hammer_and_wrench:

I still need to revise some parts of the code and make them easier to understand and use. e.g.: I use tables to manipulate the images produced, storing it’s size and pixels. But some functions use the pixel values as numbers, and others as a Color3 value. It get’s confusing trying to find which one uses which.

I also need to create more complex layers, as a neural network is not a straight forward process like shown here. it has lots of overlaping layers that operate on the data given.

There’s probably a lot more that i haven’t talked about, but we’ll figure it out later ;]

For now, I really want to learn how to use Metatables and master OOP, so I can optimize my code before I go into the more complex stuff. And for that i’ll develop a simple game, trying to use as much OOP as possible. I’ll keep you guys updated ;]


:sparkles:Feel free to ask questions, correct wrong information or give new information that might help others understand how it works!


Take care Wonderful People ;]

1 Like