Skip to content
ImagineWorld

The Neural Networks Revolution

node_idnode-book_neuro-symbolic-ai_chapter-03-the-neural-networks-revolution
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num3
chapter_titleThe Neural Networks Revolution
pillar_membershipA — predictive_processing_active_inference + D — neuroscience_anchors
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 3 — The Neural Networks Revolution

Section titled “Chapter 3 — The Neural Networks Revolution”

People have been fascinated with the inner workings of the brain for thousands of years. The first records can be traced back to a 1700 BC Egyptian papyrus, which reports the medical information of a person with a severe head injury. In Ancient Greece, Alcmaeon concluded that the brain is the organ that rules the body rather than the heart (as people thought back then) and that it also serves as the store for memories and thoughts. Furthermore, he also linked the eyes to vision processing inside the brain. Herophilus and Erasistratus of Alexandria even went a step further by distinguishing between the different components of the brain. During the Roman Empire, the Greek philosopher Galen started associating functions with the different brain parts and theorized about the function of the spinal cord. Around 1000 AD, Al-Zahrwai, the father of modern surgery, delved deeper into the inner workings of the brain. He evaluated neurological patients and treated head injuries. In Persia, Avicenna, the father of modern medicine, wrote a medical encyclopedia that, for the first time, associated mental health issues with the inner workings of the brain. During the Renaissance, Andreas Vesalius noticed the different specializations of the brain associated with different nerve cells. In the mid-18th century, Luigi Galvani observed the role of electricity in the brain to control nerves. And with the invention of the microscope, the study of the brain took a whole new dimension.

As we can see, the path was rather long and winding, spanning thousands of years. This led us to the creation of the first artificial neuron. In 1943, Warren McCulloch, a neurophysiologist, and Walter Pitts, a mathematician, wrote a paper describing how a neuron might work. And to prove their line of thinking, they recreated a single neuron using an electrical circuit. In the book The Organization of Behavior, Donald Hebb came up with the idea that neural pathways get strengthened when they are used, thus reinforcing the most preferred paths. Following this, IBM researchers started devising ways of simulating a neural network in their research lab. But the real boost came after the Dartmouth workshop in 1956, which pushed this field of study to new heights.

By 1958, the neurobiologist Frank Rosenblatt started modeling a physical perceptron. It was used to classify a stream of inputs into two distinct classes by computing the weighted sum of the inputs, removing a threshold, and passing one of the values as a result. A year later, Stanford researchers created MADALINE, the first neural network used to solve a real-world problem, and it was so successful that it’s still being used today.

However, not everything was positive. In the book Perceptrons by Marvin Minsky and Seymour Papert, they proved that the perceptron is somewhat limited since it cannot mimic complex functions properly. This brought a slowdown in the development of neural network research since researchers were fearful that they might have hit a brick wall. Such a sentiment persisted till the early 80s.

In 1985, there was a new revival for artificial neural networks (ANNs). Funding started flowing, annual meetings were organized, and in 1987, the Institute of Electrical and Electronics Engineers’ (IEEE) first International Conference on Neural Networks attracted almost 2,000 attendees. Since then, ANNs have grown in strength and become incredibly intricate, spanning several layers, each with thousands of neurons. These complex networks can achieve incredible feats, from labeling images to controlling self-driving cars, or even translating text – in some cases, as well as if not better than humans.

In this chapter, we will cover the following topics:

  • The basic idea behind artificial neural networks
  • Different types of neural networks
  • The complexities and limitations of neural networks

Artificial neural networks modeling the human brain

Section titled “Artificial neural networks modeling the human brain”

As we’ve just seen, large interconnected neural networks help us process information and model the world around us. In simple terms, as can be seen in Figure 3.1, a neuron gathers information from others using the dendrites, sums up all the inputs, and if the resultant value is beyond a certain threshold, it fires. This signal is then sent to connecting neurons through the axon. So, the dendrites are our input, the nucleus inside the neuron is where the processing happens, and the axon is our output.

Figure 3.1: The neuron (Designed by brgfx/Freepik)

If we were to translate the concepts behind the neuron as illustrated in Figure 3.1 to a computer, we would have a structure similar to the diagram in Figure 3.2. Essentially the dendrites are represented by the input nodes and there can be various inputs (X₁, X₂, X₃, …, and Xₙ). Since each physical dendrite might have different strength, this is represented in the ANN as a weight (W₁, W₂, W₃, …, and Wₙ) associated with each of the inputs. The operations inside the nucleus are represented by the summation and activation function, while the axon is the output link. [figure outside: Figure 3.1] [figure outside: Figure 3.2] Figure 3.2: Model of a perceptron

In synthesis, a perceptron comprises weights, summation, and an activation function. When it receives an input, each one is individually weighted and combined using the summation process. The activation function then decides whether the signal should be sent to the output or not. Such perceptrons are also called feed forward (FF) because they receive inputs on the left and forward the values to the right. A very simple one is a step function that outputs 1 or 0, depending on whether a particular threshold is reached. However, this is only an example, and there exist several other functions, such as the sigmoid, Tanh, and Rectified Linear Unit (ReLU).

Let’s have a look at a simple example. Imagine we need to create a neural network that detects whether a leaf is healthy or sick. The general rule is that brown spots next to the stem indicate some sort of illness. Take a look at the following diagram:

Figure 3.3: Example ANN for a healthy leaf [figure outside: Figure 3.2] [figure outside: Figure 3.3] As per Figure 3.3, first, we divide the leaf into four sections, and if we notice a brown patch in that section, we set the corresponding input to 1; otherwise, we leave it as 0. The weights have been set up beforehand based on the function we’re trying to model, so weights closer to the stem have a value of 1, and the furthest away have a value of 0.25. To calculate the input and weights, it’s simply a matter of multiplying them together and sending them to the summation function to add them up:

(0 × 1) + (0 × 0.75) + (1 × 0.5) + (1 × 0.25) = 0.75

The activation function decides whether the perceptron should fire or not. In this case, the rule is that if the value of the summation is greater than 1.25, then the leaf is sick.

Calculation tip

1.25 is half of all the values possible. Imagine all the inputs were 1 (presence of brown spots), when we multiply them with the weights, we get (1 × 1) + (1 × 0.75) + (1 × 0.5) + (1 × 0.25) = 2.5, and half of 2.5 is 1.25.

But our summation gave us a value of 0.75, which is less than the threshold, therefore the perceptron will not fire, meaning that the leaf is healthy. If we repeat the same process but this time with a different leaf, as per Figure 3.4, we can see that the input varies since the brown patches are located closer to the stem. By calculating the input and weights and sending them to the summation function, we get the following:

(1 × 1) + (0 × 0.75) + (0 × 0.25) = 1.75

Since the result is greater than 1.25, the perceptron will fire, indicating that the leaf is sick.

Figure 3.4: Example ANN for a sick leaf

The input part is relatively easy to understand. The complex part is the perceptron, regarding the selection of the weights, the aggregation, and the activation function. The way to do this is via learning. If we train a child to recognize a sick leaf, we will show them different examples and teach them the features used to identify its health. Following that, the child is then shown a new unseen leaf, and we can check whether the child learned the underlying concept or not. To train a perceptron, the same idea is used.

The problem with such an approach is that the perceptron is somewhat limiting. Keep in mind that the activation function acts like a dividing line. Anything below the threshold is rejected, and the rest is accepted. These are known as linearly separable functions. But most problems cannot be solved using such a simple mode.

Figure 3.5 shows a neural network that decides whether it should give a child sweets or ice cream. However, what happens if we add a simple rule that says that a child can choose either/or, but cannot select both? So, in one sitting, the child can either have sweets or ice cream, but not both. At this stage, the perceptron breaks because such a rule cannot be represented.

Figure 3.5: Example ANN to decide whether to give either sweets or ice cream, but not both

If we look at Figure 3.6, which shows all the available options, we find that it is impossible to draw a straight line from one end to the other, which allows us to specify that all options on one side of that line are valid while the others are not. This is because a linearly separable function cannot represent such a process on its own.

Figure 3.6: The four options (nothing, sweets only, ice cream only, and no sweets or ice cream) of the sweets and ice cream function [figure outside: Figure 3.5] [figure outside: Figure 3.6] To go around this limitation, we can simply add various perceptrons together into a multilayered neural network, as per Figure 3.7. The main difference is that the previous model made up of inputs, perceptron, and outputs is changed, whereby instead of one perceptron, we can have several. These are generally referred to as the hidden layers of an ANN.

Figure 3.7: A multilayer perceptron

In a typical ANN, one would find several hidden layers, and each layer can have any number of nodes. However, such a setup increases the complexity of the ANN, and because of this, determining the correct weights (especially in the hidden layers) becomes extremely difficult. Luckily for us, in the 1970s, an algorithm called backpropagation was created to do just that!

Figure 3.8: The backpropagation process

The concept behind backpropagation is relatively simple, as can be seen in Figure 3.8. When we start training the ANN, the weights are set randomly. When we give it an input, this will inevitably give us

Section titled “Introducing popular neural network architectures”

wrong results (due to the incorrect weights). We then compare the wrong result obtained in the output layer with the expected output and, from the difference, calculate the errors. Then, we simply take the errors and propagate them back to the hidden layers while adjusting the weights slightly throughout the process. By doing so, the error gradually decreases. The process is then repeated several times until we reach a state in which the error is so tiny that it is negligible, thus indicating that the ANN is correctly representing the function being modeled. Thus the network is unable to improve any further.

In this section, we have seen the most basic ANN architectures; the single-layer perceptron (Figure 3.2) and the multilayer perceptron (Figure 3.7). However, many others are much more complex than what we’ve seen so far. In the next section, we will explore a few of the most popular ANN architectures.

Section titled “Introducing popular neural network architectures”

In this chapter, we explore some of the most popular ANN architectures beyond the basic single-layer and multilayer perceptrons. The recurrent neural network (RNN) is a feed-forward network that incorporates temporal relationships and is widely used in applications ranging from sentence autocompletion to stock market predictions. However, RNNs suffer from the vanishing gradient problem, which hinders their learning ability. Competitive networks, such as Kohonen networks and self-organizing maps, classify inputs without supervision, while Hopfield networks, a special ANN with every node connected to every other node, act as associative memory and tend to converge based on similarities. Boltzmann machines (BMs) and restricted Boltzmann machines (RBMs) are variants of the Hopfield network that have additional restrictions and are trained using unsupervised learning approaches, making them great at extracting discriminative features from input data.

An RNN is a feed-forward network like what we’ve seen already. The significant difference is that they are not stateless. This means that rather than depending exclusively on the previous input, they also have a connection (arching lines on top of each perceptron in Figure 3.9) that feeds an input directly from their output.

Figure 3.9: RNNs [figure outside: Figure 3.2] [figure outside: Figure 3.7] [figure outside: Figure 3.9] The effect of this change is that the order of the input received by each node matters. So, if the network is analyzing the value of Bitcoin, it considers that a few months back, its value was around €60,000, whereas today, it went down to €20,000. If the temporal relationship is not considered, then the network won’t be able to learn how to predict market movements. Even though RNNs are extremely powerful, they suffer from a significant setback normally referred to as the vanishing gradient problem. When such networks learn using backpropagation or similar techniques, the error is propagated backward through the network. However, at one point, the adjustment propagated back is so small that it becomes irrelevant, and the network stops learning. Unfortunately, this happens before the network learns to represent the underlying function!

Notwithstanding this limitation, RNNs are widely used in AI and have various applications, ranging from autocompletion of sentences to stock market predictions. They are used when the input data is normally a sequence, so the temporal order is extremely important.

Competitive networks, such as Kohonen networks and self-organizing maps, are an interesting type of artificial neural network that can learn to classify inputs without requiring explicit supervision. These networks use a learning process called competitive learning, in which the neurons in the network compete with each other to become activated and respond to the input data. When an input is presented to the network, as shown in Figure 3.10, each neuron calculates its activation level based on the input, and the neuron with the highest activation level wins, thus becoming the output of the network.

Figure 3.10: Competitive networks such as Kohonen networks and self-organizing maps

The winning neuron and its neighbors are then adjusted based on the input, with the winning neuron becoming more specialized in recognizing the particular input it won, and the neighboring neurons being adjusted to recognize similar inputs. This adjustment process further refines the network’s classification abilities, making it particularly useful for applications where a large dataset is available, but the true classification labels are unknown or difficult to obtain. By learning to classify data in an unsupervised manner, competitive networks can help uncover hidden patterns and relationships in complex datasets. This makes them suitable for unsupervised learning tasks such as clustering and feature extraction.

Section titled “Introducing popular neural network architectures”

A Hopfield network is a special ANN where every node is connected to every other node (as seen in Figure 3.11). What’s interesting is the fact that the nodes have different uses. They serve as input nodes before the training starts; during the training, they act like the hidden layers, and after, they become the output nodes. When the network is trained on several patterns, it will always converge to one of the learned patterns since that guarantees the stability of the entire network. However, this does not work in all cases, and in most cases, only part of the network gains stability. Due to its particular structure, updating the network happens either synchronously or one at a time. Such networks are referred to as associative memory because they tend to converge based on the most common similarities. If this network is trained to identify faces, even though the image might have a lot of noise, it will still converge on one of the faces used for training since it is a property that emerges out of the interconnectedness of the ANN.

Figure 3.11: Hopfield network

A variant of the Hopfield network is the BM, whereby some neurons are labeled as input and others as hidden. At the end of the update, all the neurons of the full network become output neurons. The network is initially set up using random weights, which are subsequently adjusted using learning algorithms such as backpropagation (discussed earlier). The activation function is global and is controlled by a temperature value, meaning that it fires if it goes beyond a certain value (or temperature). A further variation to BMs is the RBMs, as per Figure 3.12. They are, of course, built upon similar principles as the networks mentioned in this section; however, as the name implies, they have further restrictions. The main difference is that all the nodes are not connected to all the other nodes. However, the nodes are divided into groups (input and hidden), and each node in one group is connected to all the other nodes in the other group. This means that there is no interconnectedness between nodes forming part of the same group. RBMs are trained similarly to how we’ve seen before, but there’s a significant difference. After the forward pass, the output is sent back to the first layer. Following that, forward-and-back propagation is used to train the network. Since RBMs utilize an unsupervised learning approach, they are extremely good at extracting discriminative features from input data.

Figure 3.12: Restricted Boltzmann machine

So far, we’ve explained the fundamental workings of different ANN architectures. However, there are many more complex variants, and the previous section only provided an introduction. The next section will delve deeper into the workings of deep neural networks and explore these novel architectures. It will also give an overview of the advancements made in recent years.

So far, we’ve scratched the surface of several ANNs, because there are so many variants that it would be very difficult to collate them all in this document, and it would be beyond the scope of this book. The main problem with ANNs was that toward the end of the last century, they hit a brick wall, and advancements were moving at a relatively slow pace.

This changed soon after the turn of the century due to three main reasons:

  • The amount of information available online in digital form provided a fertile ground for data-hungry algorithms such as ANNs. Just consider that up to 90% of the world’s data was created in the past 2 years, and is constantly increasing at an impressive rate of 2.5 quintillion bytes of data per day.

  • The advancement in video game development. Back then, game developers were looking at ways in which they could improve the graphics. Because of this, they needed a more powerful and dedicated processor, which is how the Graphics Processing Unit (GPU) was born. The GPU is designed like a parallel computer capable of performing mathematical functions not just on one data item but on several at once. Coincidentally, this was precisely the kind of processing that was needed to process large and complex ANNs. Because of this, AI professionals started using GPUs, which proved to be a match made in heaven since this sped up the development of more complex models. Later, companies such as Google released their own specialized versions of the GPU specifically designed for AI applications, such as the Tensor Processing Unit (TPU). During this period, we’ve also seen democratization in processing power thanks to the widespread availability of cloud processing. Thus, the combination of these factors led to the successful creation of more complex ANNs.

  • The development and use of new ANNs architectures, normally referred to as Deep Learning (DL) approaches. Many of the underlying ideas are not entirely new, and some of them have been around for the past 70 years; however, their success was limited due to the issues mentioned earlier. DL is a class of algorithms that can be used to tackle a myriad of problems in very diverse domains.

In the coming section, we will be exploring various architectures used in DL. The word deep is normally attributed to the deep hidden layers found in these types of networks through which such networks derive their effectiveness in handling complex tasks. However, before delving into these architectures, it is important to note that these networks learn using several different approaches. The four main categories are as follows:

  • Supervised learning occurs when the algorithm is provided with examples (normally input-output pairs), and the ANN learns to model that function.

  • Semi-supervised learning uses a small subset of examples for learning. It then categorizes unseen examples and adds to the training set those examples that were labeled with high confidence. The process is repeated until all the items are eventually labeled.

  • Unsupervised learning doesn’t use any examples but tries to identify underlying patterns in the data to learn possible classifications.

  • Self-supervised learning uses a semi-automatic process to learn to categorize from the data and then use that information to tackle the whole dataset.

Now that we have had a look at how DL algorithms learn, let’s have a look at the most popular ones used in various applications.

A convolutional neural network (CNN) is a kind of network inspired by the biological evolution of the visual cortex. If we look at how the eye works, we find that various receptors specialize in recognizing different features such as colors, shapes, and so on. CNN works on similar principles, and because of this, it is very much adapted to tackle computer vision applications. Similarly, the network comprises various layers that perform visual extraction followed by classification, as seen in Figure 3.13. The input image is first divided into sections that feed into the convolutional layer.

Figure 3.13: A CNN

These are used to extract features from that image. Of course, not all the features are important, so the Rectified Linear Unit (ReLU) is used as the activation function, which also helps to keep the gradient relatively constant while allowing the network to be trained without harmful consequences. The following step is pooling, which allows the CNN to focus on the most relevant patterns. It’s a sort of lens that reduces the dimensionality of the features by informing us that a feature was present but not exactly where. By doing so, a small variation will not affect the final target while also managing memory and improving speed (especially in large images). There are various iterations of the architecture just described until, finally, all the output is passed through a fully connected (FC) multilayer perceptron at the end. This is where the classification happens. Such networks are normally trained using backpropagation and have been widely successful in applications related to image processing, video recognition, and several Natural Language Processing (NLP) tasks.

A long short-term memory (LSTM) network is a special kind of RNN that doesn’t suffer from the vanishing gradient problem mentioned earlier. The basic architecture departs from the traditional neuron-based networks we’ve seen and uses a memory cell concept. The cell uses the memory component (as seen in Figure 3.14) to remember what’s important for a short or longer period. It also contains three gates – input, forget, and output – which are used to control the flow of information within the network:

  • The input gate regulates the flow of new information into memory

  • The forget gate allows the network to dispose of existing information, thus making space for new data

  • The output gate controls the usage of the data stored within each cell

LSTMs are extensively used in NLP applications since they are extremely good at processing sequences like the ones we use in natural languages. There are several variances of LSTMs, one of which is the Gated Recurrent Unit (GRU), which simplifies the existing LSTM model by removing the output gate. This makes the network use less memory and improves its performance; however, it tends to be less accurate than an LSTM when dealing with longer sequences.

Figure 3.14: An LSTM architecture showing the memory mechanism, which takes information from prior inputs

An autoencoder (Figure 3.15) is a network of three layers; input, hidden, and output. However, unlike other networks, it gathers its input, encodes it in the hidden layer, and recreates it in the output layer.

Figure 3.15: Autoencoder architecture The hidden layer typically consists of fewer nodes than the input layer, and an encoding/decoding function is used to process the data. Because of this, the error is not calculated on the output only like most other networks but is a function that finds the difference between the input and output layer. The weights are then adjusted to reduce the error further. Also, since the autoencoders constantly encode and decode the same input, there is no need to compare the outputs with any additional data like in traditional techniques, thus making the network self-supervised. Such networks have been successfully used for image compression, denoising, and feature extraction.

A deep belief network (DBM) is a typical multilayer network with an input, several hidden layers, and an output. The main difference between this and typical multilayered architectures is in the training of such a network. Rather than performing a forward pass followed by backpropagation, each pair of layers (RBM₁, RBM₂, and RBM₃) is considered an individual RBM. Because of this, we can describe the DBM as a stack of RBMs, as can be seen in Figure 3.16.

Figure 3.16: DBM architecture

The input layer gets a feed from the raw sensory input, and as the information passes through the hidden layers, it generates a different level of abstraction. The output layer then simply takes care of the final classification. The training is also divided into two phases: the first is the unsupervised pretraining, and the second is the supervised fine-tuning.

In the first phase, the second layer in every RBM is trained to reconstruct the first layer. So, the first hidden layer has to reconstruct the input layer. The second hidden layer must reconstruct the first hidden layer, and the output layer is trained to reconstruct the second hidden layer. Once all the layers have been pretrained, the second phase begins, whereby the output nodes are linked to labels to give them meaning. Once this is completed and all the weights are set, backpropagation (or any other training function) is used to finalize the training phase. Such networks have been used in sentiment analysis applications and personalization.

As the name implies, generative networks use DL methods such as CNNs (discussed earlier) to generate new information. The task comprises the automatic discovery and learning of patterns within the input data, which is then used to generate new plausible examples based on the original dataset.

The most popular ones are called generative adversarial networks (GANs), and they use a supervised learning approach. Rather than using one model, they have two: a generator and a discriminator. The role of the generator is to create new example data points based on the training dataset. These are then fed to the discriminator, which decides whether they exhibit the characteristics of the data found in the training set. If they don’t, they are simply discarded, and a new example is created. This process continues until the discriminator model identifies new data with similar characteristics at least 50% of the time, thus indicating that the generator learned to replicate examples similar to the training data. Such an approach has been successfully used to generate new texts, paraphrase, and create artistic masterpieces.

Another important model gaining traction in recent years is the diffusion model. This model starts with a training set and gradually destroys it by inserting Gaussian noise, which is a statistical noise with a probability density equal to what one would expect in a normal distribution. The learner then tries to recover the data by removing the noise and replacing it with the correct value. After the training, the diffusion model can generate an image out of noisy data. This model has been extensively used in the creation of photo-realistic computer-generated images, as shown in Figure 3.17. It also has the benefit of not using any adversarial training (as in GANs) while being scalable and parallelizable.

A transformer is a machine learning model designed to process sequential data. However, it differs from traditional networks as it does not analyze the data sequentially but utilizes an attention mechanism that gives a higher weight to objects (such as words or images) based on their context.

Self-attention is a vital component of these transformer architectures since it identifies the most essential sections of a sequence. To do so, it does the following:

  1. Encodes every object into a set of numbers (normally represented as a vector).
  2. For every object and all the other words in the sentence, it calculates the product of the two vectors.
  3. The results are normalized, multiplied by the existing weights, added together, and used as the new weights.

The effect of this process is that objects that have a semantic relationship are given more importance than others. As can be seen in Figure 3.18, the architecture uses a sequence-to-sequence model with a separate encoder and decoder.

Figure 3.18: Typical transformer architecture

The encoder consists of blocks comprising the self-attention mechanism and the feed-forward network. The decoder has three blocks: the self-attention mechanism, an encoder-decoder attention component, and a feed-forward network. The main difference between the transformers and RNNs is that a transformer is not time-dependent; thus, objects are given importance based on the attention mechanism. Since their inception, transformers obtained massive popularity since their results almost reached a human level in various tasks, such as the following:

  • Text classification: Assigning a label or category to a text, such as sentiment analysis, spam detection, and topic identification

Information extraction: Extracting structured information from unstructured text, such as named entity recognition, relation extraction, and event extraction

Question answering (QA): Generating a natural language answer to a natural language question, such as reading comprehension, factoid QA, and open-domain QA

Summarization: Producing a concise summary of a longer text or multiple texts, such as news articles, scientific papers, and reviews

Translation: Converting a text from one language to another language, such as English to French, Chinese to English, and Hindi to Urdu

Text generation: Creating new text based on some input or context, such as dialogue generation, story generation, and caption generation

Today, we live in the age of large language models with transformers such as Kimi-k2.6, BERT, T5, and many others integrated into several AI applications.

Let’s now look at the pros, cons, and applications of the networks that we’ve discussed so far:

Artificial Neural Network: Networks inspired by the structure and function of biological neurons:

Pros: Can learn complex patterns and relationships, and perform tasks such as classification, regression, and prediction

Cons: Can suffer from overfitting; may require a large amount of data and computing resources to train effectively

Applications: Image and speech recognition, natural language processing, and recommender systems

Recurrent Neural Networks: Networks that can process sequences of inputs by passing information from one time step to the next:

Pros: Can model temporal dependencies and long-term dependencies; can handle variable-length inputs

Cons: Can suffer from vanishing and exploding gradients; can be computationally expensive to train

Applications: Natural language processing, speech recognition, and time series prediction

Competitive Networks: Networks where neurons compete with each other for activation:

Pros: Can learn to classify inputs without explicit supervision; can identify prototypes or representatives in the data

  • Cons: Limited to unsupervised learning; may require hand-crafted features
  • Applications: Clustering and feature extraction
  • Hopfield Networks: Networks that can store and retrieve memories as stable patterns of activation:
  • Pros: Can store a large number of memories; can tolerate noise and incomplete patterns
  • Cons: Limited to associative memory and pattern completion tasks; may converge to incorrect states or spurious memories
  • Applications: Pattern completion and optimization problems
  • Convolutional Neural Networks: Networks that can learn hierarchical representations of inputs, particularly images:
  • Pros: Can learn spatial and translation-invariant features; can perform well with limited data
  • Cons: Can be computationally expensive to train; may require a large number of parameters
  • Applications: Image and video recognition, object detection, and segmentation
  • Long Short-Term Memory Networks: Recurrent neural networks that can better handle long-term dependencies by selectively remembering or forgetting information:
  • Pros: Can model long-term dependencies and variable-length sequences; can handle noisy and incomplete inputs
  • Cons: Can be computationally expensive to train; may suffer from vanishing gradients
  • Applications: Natural language processing, speech recognition, and time series prediction
  • Autoencoders: Networks that can learn compressed representations of inputs by encoding and decoding them:
  • Pros: Can learn meaningful representations of data; can perform data compression and denoising
  • Cons: Limited to unsupervised learning; may suffer from overfitting
  • Applications: Data compression, denoising, and feature extraction
  • Deep Belief Networks: Networks composed of multiple layers of restricted Boltzmann machines, can learn hierarchical representations of data:
  • Pros: Can learn complex and abstract features; can perform unsupervised pretraining followed by supervised fine-tuning
  • Cons: Can be computationally expensive to train; limited to classification and generation tasks
  • Applications: Image and speech recognition and generative modeling Generative Networks: Networks that can generate new samples of data similar to the training data:

Pros: Can generate realistic and diverse samples; can be conditioned on specific inputs Cons: Can be computationally expensive to train; may suffer from mode collapse

Applications: Image and speech synthesis, data augmentation, and anomaly detection

AI Transformers: Networks that use self-attention mechanisms to process sequential data:

Pros: Can process sequential data of varying lengths; can capture long-range dependencies and achieve state-of-the-art performance in language modeling Cons: Can be computationally expensive to train; may require large amounts of data for optimal performance

Applications: NLP, text generation, machine translation, speech recognition, and image captioning

In this section, we explored some of the most popular ANN architectures beyond the basic single-layer and multilayer perceptrons. Each architecture has its strengths and weaknesses, making it suitable for specific tasks. However, as we’ll see in the next chapter, the rise of data has allowed researchers to train increasingly complex models that can handle more significant and complex datasets. The rise of big data has been a game-changer for machine learning, enabling researchers to develop new algorithms and techniques to tackle challenging problems. In the following chapter, we will delve deeper into the rise of data and its impact on the development of deep learning.

Data refers to the raw facts and figures that are collected and processed to provide useful information. In this context, data is essential for training models to recognize patterns and make predictions. The rise of data has been closely linked with the growth of the internet. As more people have come online and generated more information, the amount of data available has grown exponentially. This has had a profound impact on deep learning, enabling researchers to develop increasingly sophisticated models that can learn from vast amounts of data. As more people came online, companies began to realize the value of this data. They started collecting it en masse, using it to gain insights into customer behavior and preferences. This led to the emergence of big data – large datasets that were too complex to be processed using traditional methods. Big data presented a challenge for machine learning researchers. Traditional machine learning algorithms were not designed to handle such large amounts of information. However, this challenge also presented an opportunity to develop new algorithms that could learn from vast amounts of data.

One of the key technologies that have enabled this growth in data is the development of advanced sensors and devices. These devices can collect data on everything from temperature and humidity to heart rate and blood pressure. They can be embedded in everything from smartphones and wearable devices to cars and industrial machinery. As these devices have become more widespread, they have generated vast amounts of data. This data can be used to gain insights into everything from human behavior to machine performance. It has also enabled new applications such as predictive maintenance and personalized medicine. Big data has had a profound impact on many industries, including healthcare, finance, and retail:

In healthcare, big data is being used to improve patient outcomes by analyzing large datasets to identify patterns and trends. For example, researchers can use big data to identify risk factors for diseases such as diabetes and heart disease.

In finance, big data is being used to improve risk management by analyzing large datasets to identify patterns and trends. For example, banks can use big data to identify fraudulent transactions and assess credit risk.

In retail, big data is being used to improve customer experiences by analyzing large datasets to understand customer behavior and preferences. For example, retailers can use big data to personalize marketing campaigns and improve inventory management. By analyzing customer purchase histories and browsing behavior, retailers can gain insights into what products are popular and when they are likely to sell out. This can help them optimize their inventory levels and reduce waste.

Overall, the internet and technology have enabled the creation and collection of massive amounts of data, which has had a profound impact on many industries, enabling new applications and improving efficiency. As technology continues to advance, it is likely that we will see even more innovative uses of big data in the future.

However, big data is not always available and, because of this, there is active research going on in the use of small data. This refers to datasets that are smaller in size and complexity compared to big data. Despite their smaller size, small datasets can still be incredibly valuable for deep learning. They can provide high-quality information that is relevant to a specific problem or domain. One of the key benefits of small data is that it can be easier to work with than big data. Small datasets are often more manageable and can be processed using traditional machine learning algorithms. This makes them a good choice for researchers who are just starting out in the field of deep learning.

In addition to small data, synthetic data is also becoming increasingly important in deep learning. It refers to artificially-generated data that is created using computer algorithms. This type of data can be used to augment existing small datasets or create entirely new ones. Another key benefit of synthetic data is that it allows researchers to generate large amounts of high-quality training data quickly and easily. This can be especially useful when working with complex problems such as image recognition or natural language processing.

To facilitate global research efforts, many datasets have been created, which played a key role in advancing deep learning research and applications. Some of the most widely used datasets include MNIST, MS-COCO, ImageNet, Open Images Dataset, VisualQA, and Street View House Numbers (SVHN):

  • MNIST is a dataset of handwritten digits that has become a benchmark for evaluating machine learning algorithms. It consists of 70,000 images of digits from 0 to 9. Each image is 28x28 pixels in size and is represented as a grayscale value.

  • MS-COCO is a large-scale dataset for object detection, segmentation, and captioning. It contains over 330,000 images with more than 2.5 million object instances. The dataset includes a wide range of objects and scenes, making it a valuable resource for training deep learning models.

  • ImageNet is another large-scale image dataset that has been widely used in deep learning research. It contains over 14 million images organized into more than 20,000 categories. The images in ImageNet are high-resolution and cover a wide range of subjects.

  • The Open Images Dataset is another large-scale image dataset that has been used in deep learning research. It contains over 9 million images with diverse annotations such as object labels and bounding boxes.

  • VisualQA is a dataset for visual question answering that contains over 250,000 images with associated questions and answers. The dataset is designed to test the ability of deep learning models to understand and reason about visual information.

  • The SVHN dataset is a real-world image dataset for digit recognition. It contains over 600,000 images of house numbers extracted from Google Street View. The images are in color and vary in size and resolution.

These datasets have played a crucial role in advancing deep learning research and applications. They have provided researchers with large amounts of high-quality data that can be used to train and validate deep learning models. By using these datasets, researchers have been able to develop increasingly sophisticated models that can recognize patterns and make predictions with high accuracy.

In conclusion, data has played a crucial role in advancing deep learning research and applications. The rise of the internet and the development of advanced sensors and devices have enabled the creation and collection of massive amounts of data. This data has provided researchers with valuable resources for training and validating deep learning models. As a result, we have seen significant progress in many areas of deep learning research, including image recognition, natural language processing, and predictive analytics. Big data has also had a profound impact on many industries, including healthcare, finance, and retail. Overall, the rise of data has been a key driver of innovation in deep learning research and applications.


The complexities and limitations of neural networks

Section titled “The complexities and limitations of neural networks”

As we’ve seen in previous sections, ANNs are extremely powerful and extensively used in different AI applications. Notwithstanding this, they are very complex machines (some of them are reaching the one trillion parameter mark), and because of this, they suffer from various limitations. The following are some of the most critical issues.

The first issue with ANNs is their “black box” nature. When we refer to an algorithm, we mean that the algorithm can get a set of inputs and return a set of outputs, but we are not entirely sure about how it achieved those results since the inner workings are not visible. It’s like looking at a black box machine, hence the name! So, if we create a neural network to distinguish between a cat and a dog, we cannot say how it managed to do it, whether it’s the color of the animal, the pointy ears, or its long tail.

Human-interpretable features are much more preferred since, by analyzing them, we can have the certainty that the algorithm is not just working but also working well. Also, if there is a mistake, we can be in a better position to identify it and correct the origin of that mistake. Until ANNs become interpretable, it will be very hard to use them in critical situations, especially when people’s lives are at stake.

In some applications, such as in the courts of justice, dishing out decisions about people’s lives is not enough. Decisions must be justified, and those justifications need to follow coherent logic. If this information is not available, how is it possible for an accused person to ever defend themselves or appeal against the sentence? Because of this, explainability should be an inherent feature of many applications – something that ANNs still find hard to achieve.

The problem with infusing explainability within an ANN algorithm is related to complexity. Libraries such as Keras, PyTorch, and Caffe make the lives of programmers developing neural networks much more straightforward than if they had to program them from scratch. They do so by abstracting over mathematics, the details of the algorithm, and the hyperparameters. However, one shouldn’t forget that even though these libraries are available, solving an AI problem is never easy. In most cases, very few people around the world would have solved a similar problem because AI is very pervasive and can be applied to almost anything. To tackle such a problem, one might have to resort to using lower-level libraries or maybe coding parts of the network from scratch. Of course, there is always a threshold between the coding complexity required and the improvement obtained. If the difference is not that much, it might be more worth opting for a simpler algorithm that might give you similar results.

Identifying the correct algorithm is only part of the story. ANNs typically make use of much more data than other traditional machine learning algorithms. Some of them even require labeled data, which might require human intervention. This tends to be very problematic because data is not always readily available, and when it is, the quality needs to be checked. In recent years, researchers have been moving away from the realms of big data and more toward creating better algorithms that can work with small data. When the data available is problematic, researchers are also looking at synthetic data, which allows them to generate massive amounts of data points in the lab.

Finally, once we have the algorithm and the data, we need to use them. This, unfortunately, tends to be computationally expensive, making it difficult for anyone to use large models on their personal computer. Training large networks can sometimes take several weeks to train from scratch. This is very different from what typically happens with traditional machine learning algorithms, which normally take a few hours or, at most, a few days.

So ANNs can be pretty challenging to use. Of course, this is the cost one needs to pay in exchange for all the power. However, research is also advancing at a very fast pace. In the coming years, we will see the development of better, more powerful models, which are explainable and within reach of everyone.

In this chapter, we looked at ANNs and how they evolved from simple concepts to powerful AI models. We also had a run-through of the most popular architectures in use today, starting from the humble perceptron and finishing with the powerful transformer model. Finally, we skimmed through the complexities and limitations of ANNs to get an overview of the open challenges that still exist – hence why we need to seek new, more powerful alternatives. Because of this, in our next chapter, we will look at explainable AI and its various approaches that help to build trust in AI systems.