Python tutorial to create your own artificial neural network for multi-class classification Galaxy Image Training Data galaxy image training data set and MNIST data set

In today's casual coding exercise, we'll build an artificial neural network from scratch and train it to classify galaxies. In machine learning, a multiclass classification problem is the problem of classifying objects into one of three or more classes. In this example, we classify images of galaxies as elliptical, spiral, or irregular.

Before we start, here is a gif of our AI multiclass classification algorithm running:

Create your own artificial neural network for multiclass classification

Artificial neural networks

In artificial intelligence/deep learning, an artificial neural network is a mathematical operator that takes an input vector x (features) and produces an output vector h_θ ( x ) (labels), where θ represents a matrix whose values ​​are trained (weights) The collection of is on a dataset with known labels. For example, the input x could be an image flattened into a vector, and the output could be an array of probabilities, where the ith entry is the probability that the input belongs to class i.

A neural network consists of multiple layers. There is an input layer, one or more hidden layers, and a final output layer. Data is passed from one layer to the next via matrix multiplication θ^(i), and then a non-linear activation function g(x) is applied, which returns a value between 0 and 1 (consider values ​​close to 1, similar to the human brain firing neurons in ). Additionally, a bias term of 1 is added to the vector output of each layer, which shifts the activation function to the positive or negative side as needed during model training.

A neural network might look like the following schematic, which shows an example with three layers:

image.png

Guess you like

Origin blog.csdn.net/iCloudEnd/article/details/132202453