What is a neural network in artificial intelligence
We often hear about artificial intelligence (AI), in games, mobiles and various applications but what exactly is it and what does it serve us?
In programming language Python we have several AI libraries. These make use of neural networks with libraries such as Tensorflow, Keras, pyTorch, scikit.
Models
The first thing we should do using them is to make one model. This model when structurally ready should be trained (trained) with one dataset (amount of data). Depending on how many times it (the model) is trained, its accuracy will increase. The number of trainings you name epochs.
We can make our own model, or use one of the ready-made ones in the libraries. We can do it too train or use it pretrained.
Machine learning vs Deep learning
In an AI model we have one input layer which we feed the data. Then at least one layer that does the conversion (hidden layer) and finally an output. In this case we are talking about machine learning.
In case we have more than one hidden layer then we are talking about deep learning.
That deep learning you use in cases where we need to filter multiple times so we can have a conclusion.
CNNs for a sixth sense
There are many types of neural networks but we will specifically deal with them CNN (convolutional neural networks).
We see their use every day. In recognition of text, objects/persons in photos and videos, copyright recognition in music and much more.
The network in each hidden layer divides the image into small panels called my tensors. With a filter (usually a 3×3 matrix) called kernel (something like Instagram ones). The filter shapes the image by passing over each tensor.
Activation functions
As a result, one has been created activation map with the modulated tensors. Then one is applied activation function which is usually the ReLu. Its use ReLu it simply puts zero to any value in the array (tensor) is below zero.
Then another function called is applied max pooling. Using it essentially condenses the table into fewer dimensions, keeping the maximum value according to the step we have set.
It is selected maxpooling 1D, 2D, 3D depending on whether we convert to text, image or video respectively.
This whole process belongs to the first hidden layer. We may have more and the corresponding procedure is done in a second, third, etc.
The result
Just before the result we have the flatten layer. There, all the data we have collected is compared with all the possible answers. In the end depending on what has the highest probability it gives us this as an answer to the output. This process is done through the function soft max ή sigmoid.
So what good is a neural network?
With the neural network, as we saw in the example, we were able, through this whole process, to get an answer to the question of whether the tiger in the photo has brown eyes.
Depending on the accuracy of the model, this answer has a higher probability of being correct.
Using the image and sound data we have collected. The application can solve complex problems such as categorization, text and speech reading.