Now, artificial intelligence (AI) can identify objects in images from different angles, talk to you, and play games with you. But this begs the question: just how does it all work?
To the four months younger me, AI was magic. The fact that rigorous computer code emulates human behaviour seemed paradoxical. So, I decided to figure it out. I readied myself for mindblowing confusion, but after some digging, I found that AI’s complexity is nothing more than many, many simple operations.
Principles of neural networks
To illustrate this, let’s look at artificial neural networks or neural networks in short. They are the foundation of AI that makes decisions based on data. Essentially, data is inputted into the neural network, and thousands of operations transform this input into a decision. An Instagram feed is the decision made by a neural network with the posts seen as input; likewise, to stop the self-driving car is also the decision made by a neural network with the car’s cameras as input.
Remember that many simple operations constitute complex behaviours? In terms of neural networks, they are nodes and connections between such nodes. Resembling the neurons and synapses of a human brain, many nodes are connected to each other in complex ways to allow intelligent decision making.
Before we get into the specific way nodes are arranged and connected, let’s quickly talk about what nodes and connections actually do. In the simplest case, nodes just store a single number, but only remembering data isn’t helpful; it’s connections between nodes that modify and transfer what’s stored in the nodes, so data can be analyzed. These connections range from just multiplying the data by a designated number to plugging the number into a nonlinear function.
Fully-connected neural networks
Then, how can we actually structure nodes and connections to make them useful in a neural network? In AI, there are many different types of neural networks with unique structures, but for this introduction, we will discuss a specific type: fully connected neural networks, which are often used in combination with other neural networks to recognize images.
In fully connected neural networks, nodes are lined up into columns, which are called layers. As the name suggests, every node in every layer (except for the last) is connected to every node in the next layer. In this neural network, the number of layers and the number of nodes in each layer may vary; however, the property of being “fully connected” doesn’t change.
As usual, each node holds a number, and connections between nodes multiply that number by a certain amount and pass it onto the next node. In this case, if a node has multiple connections coming into it, all the data from each connection is added together. Usually, before data is stored by the next node, it’s also plugged into a function and thus further modified.
Then, where are the input and the output? Initially, all of the nodes are empty, and raw input data fills in the leftmost layer of the diagram. Then, connections modify and transfer these data to further nodes, and the data is gradually moved to the right as it’s processed. Finally, the right-most layer’s nodes get their data and output it. You might ask how is this relevant to decision making, but in fact, the output from the rightmost layer is often assigned significance. For example, each output node represents a possible decision, and the node with the largest number is the decision the neural network makes.
Of course, a neural network needs to know exactly what amount to multiply the data by in each connection to be functional: this process of obtaining the “settings” of the neural network is known as training. However, for this introductory article, you just have to know that neural networks are sophisticated structures of nodes and connections, and they process input data to make a decision.