How does the ‘black box’ in a neural network work?

338 views

Trying to understand Deep Learning but all the resources I’m finding are like: “and inside this black box is where the magic little goblin twists his dials and out comes your probability!”

Ugh.

In: 1

7 Answers

Anonymous 0 Comments

It’s the same way your brain can identify a truck is a truck but you can’t necessarily explain why a truck is a truck.

Your brain is the black box and the logic it used to make the judgement is hidden from you even though the one come works.

Anonymous 0 Comments

The phrase “black box” in this case refers to the concept of a complex machine or process, the details of which are unknown or not understood by the user.

So answering how the black box works is impossible by definition because if it could be explained it wouldn’t be a black box.

Anonymous 0 Comments

We don’t know. That’s what a black box is, ultimately. It’s a box where you insert data, and it outputs responses, based on processes you don’t or can’t fully understand.

In practice, neural networks are nightmarishly complicated nests of feedback loops. We can’t understand them because they don’t do anything we can recognize with the inputs, for all that the outputs are generally usable. They work kinda the same way our own brains do, where you can go from getting a stream of electrochemical inputs coming down the optic nerves, to thinking, “I am going to pet that cat,” with zero conscious steps occurring between those two events. The brain did a lot of *stuff* and output a desire to pet the cat.

Anonymous 0 Comments

There’s a great series called “Neural Networks from Scratch in Python” and it shows you how to build the black box. Highly recommend it.

I’m currently programming a neural network to play monopoly against AI players with particular play styles and learn the best overall strategy, plus adding some moral detection to determine strategies for best overall (all players) score.

It’s hard to say exactly what’s going on in any given black box, because it depends on the task. Let’s set an example and talk about it.

Let’s say we’re training an algo to look for bananas in a picture. A picture is a 2D grid of RGB pixels, we can do math on those. One neuron may be programmed to light up if it detects the color yellow, another to detect a certain brightness of the picture, another (further along the chain) to recognize the shape of a set of yellow pixels in a 2d grid. All of these things are done mathematically.

There are also sets of biases (dials) built into these neurons. These biases increase the “importance” of the neuron in the final outcome of accurately detecting the banana during training. For example, say the network runs a million times, but in the successful triggers that yellow detector is much more valuable than one that looks for a different color or something… that dial gets a boost so that when the network runs on unknowns, that neuron’s input is valued more highly.

Anonymous 0 Comments

Basically, it just means that humans can’t figure out the neural network’s algorithm.

Consider an AI that is being trained to distinguish between cats and dogs. Humans give the computer a training set: hundreds of pictures of cats and dogs rectangles of all different colors, breeds, and sizes. Each of these pictures is labeled by people, so the computer can see the correct answer.

There are several different components of each picture that the computer can consider. Fur length, tail length, nose width, size, eyes, color, ear shape, etc… Some characteristics, like fur length and color, are less important than others. At first, the AI looks at each trait equally to guess if the image is a cat or dog.

When the computer guesses wrong, it’ll try different weights (basically a number that says whether the characteristic is important or not). Maybe eye shape and nose shape are more important (and need higher weights) while fur color is less important (needing a lower weight). The computer cycles through many different weight combinations until it finally guesses right.

Then the AI applies this combination of weights to the next picture. Once again, it makes adjustments until it guesses correctly. Over time, the computer eventually reaches a combination of weights that allows it to guess every picture correctly.

Now, imagine this but way more complex. The AI might look for certain characteristics first, and then use different combinations of weights depending on that first analysis. This can happen dozens of times, with each characteristic influencing the weighting to distinguish the next characteristic.

For example, maybe the AI determines that the animal is small. Then it considers all of the characteristics that might be present in a small dog or cat. Does it have pointed ears? If yes, then it further adjusts the weights to consider all the characteristics it has seen associated with small, pointed-ear dogs and cats.

It is difficult to overstate how complex this decision tree can become. Maybe if the animal is just a little bigger, the AI considers tail length to be more important than ear shape. Since people didn’t program these weights, the exact algorithms the AI uses can be impossible to figure out.

There are so many combinations that can lead to the same outcome…if you take the same AI and train them on the same image set but with the images in a different order, they might eventually arrive at the same answers in very different ways.

This makes sense: people do the same thing. You might look at an animal, notice a long nose, floppy ears, and long tail, and determine it’s a dog. I might look at the same animal, see a bone in its mouth and hear it panting and determine its a dog based on that. For each of us, the specific set of characteristics we notice first trigger various memories in our heads that tell our brain: yep, it’s a dog. In reality, there are millions of combinations of characteristics and corresponding memories that can lead a person to recognize a dog.

The same goes for a deep learning network.

Anonymous 0 Comments

Well there used to be more focus on the workings of that black box before neutral nets went mainstream, but the thing is developing different neural net architectures is -really- complicated. And picking an architecture an model that’s already been designed and trained and treating it as a black box allows you to simply use neural nets without needing an entire course.

Also something kindof funny, one of my friends who was studying neural nets had a teacher outright state that the development was advancing so quickly that whatever he was teaching was going to be out of date by the time he graduated. So that doesn’t help 😀

Though it’s not like the info isn’t there, it’s just that the simplified version is still a lot of info. I would recommend starting here:

https://developers.google.com/machine-learning/crash-course

Anonymous 0 Comments

Neural networks are driven by linear algebra. The black box is divided into several layers. In each layer is a collection of nodes. The value of each node is produced by multiplying the value of each node in the previous value by a different constant and summing them together. This creates a chain of dependencies which map the values of the inputs to the values of the outputs. Each layer get represented as a matrix and they get multiplied together to perform the mapping.

Now, the “little goblin stuff” refers to how the constants in the layers get determined, and the actual math involved is well beyond an ELI5. The basic process goes like this: You have a set of training data for which you know what the output should be for those inputs. You feed the training data into your model, and compare the outputs it produces to what it should be. Based on the differences, you adjust the values in the layers. Then you test it again and adjust the layers again. You keep repeating this iterative process until the model processes the results you want.

Reason this is called a black box is because this process can be entirely automated and the resulting values probably won’t make sense to a human being.