Connect with us

AI 101

What is Deep Learning?

mm

Deep learning is one of the most influential and fastest growing fields in artificial intelligence. However, getting an intuitive understanding of deep learning can be difficult because the term deep learning covers a variety of different algorithms and techniques. Deep learning is also a subdiscipline of machine learning in general, so it’s important to understand what machine learning is in order to understand deep learning.

What is Machine Learning?

Deep learning is an extension of some of the concepts originating from machine learning, so for that reason, let’s take a minute to explain what machine learning is.

Put simply, machine learning is a method of enabling computers to carry out specific tasks without explicitly coding every line of the algorithms used to accomplish those tasks. There are many different machine learning algorithms, but one of the most commonly used algorithms is a multilayer perceptron. A multilayer perceptron is also referred to as a neural network, and it is comprised of a series of nodes/neurons linked together. There are three different layers in a multilayer perceptron: the input layer, the hidden layer, and the output layer.

The input layer takes the data into the network, where it is manipulated by the nodes in the middle/hidden layer. The nodes in the hidden layer are mathematical functions that can manipulate the data coming from the input layer, extracting relevant patterns from the input data. This is how the neural network “learns”. Neural networks get their name from the fact that they are inspired by the structure and function of the human brain.

The connections between nodes in the network have values called weights. These values are essentially assumptions about how the data in one layer is related to the data in the next layer. As the network trains the weights are adjusted, and the goal is that the weights/assumptions about the data will eventually converge on values that accurately represent the meaningful patterns within the data.

Activation functions are present in the nodes of the network, and these activation functions transform the data in a non-linear fashion, enabling the network to learn complex representations of the data. Activation functions multiply the input values by the weight values and add a bias term.

What is Deep Learning?

Deep learning is the term given to machine learning architectures that join many multilayer perceptrons together, so that there isn’t just one hidden layer but many hidden layers. The “deeper” that the deep neural network is, the more sophisticated patterns the network can learn.

The deep layer networks comprised of neurons are sometimes referred to as fully connected networks or fully connected layers, referencing the fact that a given neuron maintains a connection to all the neurons surrounding it. Fully connected networks can be combined with other machine learning functions to create different deep learning architectures.

Different Types of Deep Learning

There are a variety of deep learning architectures used by researchers and engineers, and each of the different architectures has its own specialty use case.

Convolutional Neural Networks

Convolutional neural networks, or CNNs, are the neural network architecture commonly used in the creation of computer vision systems. The structure of convolutional neural networks enables them to interpret image data, converting them into numbers that a fully connected network can interpret. A CNN has four major components:

  • Convolutional layers
  • Subsampling/pooling layers
  • Activation functions
  • Fully connected layers

The convolutional layers are what takes in the images as inputs into the network, analyzing the images and getting the values of the pixels. Subsampling or pooling is where the image values are converted/reduced to simplify the representation of the images and reduce the sensitivity of the image filters to noise. The activation functions control how the data flows from one layer to the next layer, and the fully connected layers are what analyze the values that represent the image and learn the patterns held in those values.

RNNs/LSTMs

Recurrent neural networks, or RNNs, are popular for tasks where the order of the data matters, where the network must learn about a sequence of data. RNNs are commonly applied to problems like natural language processing, as the order of words matters when decoding the meaning of a sentence.  The “recurrent” part of the term Recurrent Neural Network comes from the fact that the output for a given element in a sequence in dependant on the previous computation as well as the current computation. Unlike other forms of deep neural networks, RNNs have “memories”, and the information calculated at the different time steps in the sequence is used to calculate the final values.

There are multiple types of RNNs, including bidirectional RNNs, which take future items in the sequence into account, in addition to the previous items, when calculating an item’s value. Another type of RNN is a Long Short-Term Memory, or LSTM, network. LSTMs are types of RNN that can handle long chains of data. Regular RNNs may fall victim to something called the “exploding gradient problem”. This issue occurs when the chain of input data becomes extremely long, but LSTMs have techniques to combat this problem.

Autoencoders

Most of the deep learning architectures mentioned so far are applied to supervised learning problems, rather than unsupervised learning tasks. Autoencoders are able to transform unsupervised data into a supervised format, allowing neural networks to be used on the problem.

Autoencoders are frequently used to detect anomalies in datasets, an example of unsupervised learning as the nature of the anomaly isn’t known. Such examples of anomaly detection include fraud detection for financial institutions. In this context, the purpose of an autoencoder is to determine a baseline of regular patterns in the data and identify anomalies or outliers.

The structure of an autoencoder is often symmetrical, with hidden layers arrayed such that the output of the network resembles the input. The four types of autoencoders that see frequent use are:

  • Regular/plain autoencoders
  • Multilayer encoders
  • Convolutional encoders
  • Regularized encoders

Regular/plain autoencoders are just neural nets with a single hidden layer, while multilayer autoencoders are deep networks with more than one hidden layer. Convolutional autoencoders use convolutional layers instead of, or in addition to, fully-connected layers. Regularized autoencoders use a specific kind of loss function that lets the neural network carry out more complex functions, functions other than just copying inputs to outputs.

Generative Adversarial Networks

Generative Adversarial Networks (GANs) are actually multiple deep neural networks instead of just one network. Two deep learning models are trained at the same time, and their outputs are fed to the other network. The networks are in competition with each other, and since they get access to each other’s output data, they both learn from this data and improve. The two networks are essentially playing a game of counterfeit and detection, where the generative model tries to create new instances that will fool the detective model/the discriminator. GANs have become popular in the field of computer vision.

Deep Learning Summary

Deep learning extends the principles of neural networks to create sophisticated models that can learn complex patterns and generalize those patterns to future datasets. Convolutional neural networks are used to interpret images, while RNNs/LSTMs are used to interpret sequential data. Autoencoders can transform unsupervised learning tasks into supervised learning tasks. Finally, GANs are multiple networks pitted against each other that are especially useful for computer vision tasks.

Blogger and programmer with specialties in Machine Learning and Deep Learning topics. Daniel hopes to help others use the power of AI for social good.

AI 101

Co je hluboké učení?

mm

Hluboké učení je jedním z nejvlivnějších a nejrychleji rostoucích oborů umělé inteligence. Získat intuitivní pochopení hlubokého učení však může být obtížné, protože tento termín pokrývá řadu různých algoritmů a technik. Hluboké učení je také obecně poddisciplínou strojového učení, proto je pro jeho pochopení důležité vědět, co strojové učení je.

Co je strojové učení?

Hluboké učení je rozšířením některých konceptů pocházejících ze strojového učení, proto si na chvíli vysvětleme, co strojové učení je.

Zjednodušeně řečeno, strojové učení je metoda, která umožňuje počítačům provádět konkrétní úkoly bez explicitního naprogramování každého řádku algoritmů použitých k jejich splnění. Existuje mnoho různých algoritmů strojového učení, ale jedním z nejčastěji používaných je vrstvený perceptron. Vrstvený perceptron se také označuje jako neuronová síť a skládá se z řady propojených uzlů/neuronů. Vrstvený perceptron má tři různé vrstvy: vstupní vrstvu, skrytou vrstvu a výstupní vrstvu.

Vstupní vrstva přivádí data do sítě, kde jsou zpracovávána uzly ve střední/skryté vrstvě. Uzly ve skryté vrstvě jsou matematické funkce, které mohou data ze vstupní vrstvy upravovat a extrahovat z nich relevantní vzorce. Takto neuronová síť “učí”. Neuronové sítě získaly své jméno podle toho, že jsou inspirovány strukturou a funkcí lidského mozku.

Spojení mezi uzly v síti mají hodnoty zvané váhy. Tyto hodnoty jsou v podstatě předpoklady o tom, jak jsou data v jedné vrstvě spojena s daty ve vrstvě následující. Jak se síť učí, váhy se upravují, a cílem je, aby se váhy/předpoklady o datech nakonec ustálily na hodnotách, které přesně reprezentují smysluplné vzorce v datech.

V uzlech sítě se nacházejí aktivační funkce, které transformují data nelineárním způsobem, což síti umožňuje učit se komplexní reprezentace dat. Aktivační funkce násobí vstupní hodnoty hodnotami vah a přidávají tzv. bias (posunutí).

Co je hluboké učení?

Hluboké učení je termín pro architektury strojového učení, které spojují mnoho vrstvených perceptronů dohromady, takže není jen jedna skrytá vrstva, ale mnoho skrytých vrstev. Čím “hlubší” je hluboká neuronová síť, tím sofistikovanější vzorce se může naučit.

Hluboké síťové vrstvy tvořené neurony se někdy označují jako plně propojené sítě nebo plně propojené vrstvy, což odkazuje na skutečnost, že daný neuron je propojen se všemi neurony ve svém okolí. Plně propojené sítě lze kombinovat s dalšími funkcemi strojového učení a vytvářet tak různé architektury hlubokého učení.

Různé typy hlubokého učení

Výzkumníci a inženýři používají různé architektury hlubokého učení a každá z nich má své specifické použití.

Konvoluční neuronové sítě

Konvoluční neuronové sítě, neboli CNN, jsou architekturou neuronových sítí běžně používanou při vytváření systémů počítačového vidění. Struktura konvolučních neuronových sítí jim umožňuje interpretovat obrazová data a převádět je na čísla, která může plně propojená síť interpretovat. CNN má čtyři hlavní komponenty:

  • Konvoluční vrstvy
  • Vzorkovací/poolingové vrstvy
  • Aktivační funkce
  • Plně propojené vrstvy

Konvoluční vrstvy přijímají obrazy jako vstupy do sítě, analyzují je a získávají hodnoty pixelů. Vzorkování nebo pooling je místo, kde jsou obrazové hodnoty převedeny/zredukovány pro zjednodušení reprezentace obrazů a snížení citlivosti obrazových filtrů na šum. Aktivační funkce řídí tok dat z jedné vrstvy do druhé a plně propojené vrstvy analyzují hodnoty reprezentující obraz a učí se vzorce obsažené v těchto hodnotách.

RNN/LSTM

Rekurentní neuronové sítě, neboli RNN, jsou oblíbené pro úlohy, kde záleží na pořadí dat a kde se síť musí učit o sekvenci dat. RNN se běžně aplikují na problémy jako zpracování přirozeného jazyka, protože při dekódování významu věty záleží na pořadí slov. “Rekurentní” část termínu Rekurentní neuronová síť pochází ze skutečnosti, že výstup pro daný prvek v sekvenci závisí na předchozím výpočtu i na aktuálním výpočtu. Na rozdíl od jiných forem hlubokých neuronových sítí mají RNN “paměť” a informace vypočítané v různých časových krocích sekvence se používají k výpočtu konečných hodnot.

Existuje více typů RNN, včetně obousměrných RNN, které při výpočtu hodnoty prvku berou v úvahu kromě předchozích položek i budoucí položky v sekvenci. Dalším typem RNN je síť Long Short-Term Memory, neboli LSTM. LSTM jsou typem RNN, které dokážou zpracovávat dlouhé řetězce dat. Běžné RNN mohou být obětí tzv. “problému explodujícího gradientu”. K tomuto problému dochází, když se řetězec vstupních dat stane extrémně dlouhým, ale LSTM mají techniky, jak tomuto problému čelit.

Autoenkodéry

Většina dosud zmíněných architektur hlubokého učení se aplikuje na problémy učení s učitelem spíše než na úlohy učení bez učitele. Autoenkodéry dokážou transformovat data z učení bez učitele do formátu učení s učitelem, což umožňuje použití neuronových sítí na daný problém.

Autoenkodéry se často používají k detekci anomálií v datových sadách, což je příklad učení bez učitele, protože povaha anomálie není známa. Příkladem takové detekce anomálií je detekce podvodů pro finanční instituce. V tomto kontextu je účelem autoenkodéru stanovit základní linii běžných vzorců v datech a identifikovat anomálie nebo odlehlé hodnoty.

Struktura autoenkodéru je často symetrická, se skrytými vrstvami uspořádanými tak, aby výstup sítě připomínal vstup. Čtyři typy autoenkodérů, které se často používají, jsou:

  • Běžné/prosté autoenkodéry
  • Vícevrstvé enkodéry
  • Konvoluční enkodéry
  • Regularizované enkodéry

Běžné/prosté autoenkodéry jsou pouze neuronové sítě s jednou skrytou vrstvou, zatímco vícevrstvé autoenkodéry jsou hluboké sítě s více než jednou skrytou vrstvou. Konvoluční autoenkodéry používají konvoluční vrstvy místo plně propojených vrstev nebo vedle nich. Regularizované autoenkodéry používají specifický typ ztrátové funkce, která umožňuje neuronové síti provádět složitější funkce než jen kopírování vstupů na výstupy.

Generativní soupeřivé sítě

Generativní soupeřivé sítě (GANs) jsou ve skutečnosti více hlubokými neuronovými sítěmi namísto jedné sítě. Dva modely hlubokého učení jsou trénovány současně a jejich výstupy jsou předávány druhé síti. Sítě spolu soutěží, a protože mají přístup k výstupním datům té druhé, obě se z těchto dat učí a zlepšují. Tyto dvě sítě v podstatě hrají hru na padělání a detekci, kde generativní model se snaží vytvořit nové instance, které oklamají detekční model/diskriminátor. GANs získaly popularitu v oblasti počítačového vidění.

Shrnutí hlubokého učení

Hluboké učení rozšiřuje principy neuronových sítí a vytváří sofistikované modely, které se dokážou učit komplexní vzorce a zobecňovat je pro budoucí datové sady. Konvoluční neuronové sítě se používají k interpretaci obrazů, zatímco RNN/LSTM se používají k interpretaci sekvenčních dat. Autoenkodéry dokážou transformovat úlohy učení bez učitele na úlohy učení s učitelem. Nakonec, GANs jsou více sítěmi, které jsou postaveny proti sobě a jsou obzvláště užitečné pro úlohy počítačového vidění.

Blogger and programmer with specialties in Machine Learning and Deep Learning topics. Daniel hopes to help others use the power of AI for social good.