AI: the architecture

There are three other things that you will need to decide, the loss function, the optimiser and the metrics. These are the next layer of decisions you need to make and they are essential parts of what goes into an AI model. This is after you have decided what your model will look like. 

Loss: the loss is to be minimised. Loss (sometimes called the cost) is the difference between what the model guesses and what is the target (label). So if it predicts that an image is dog when it is a cat it then needs to make adjustments to minimise that difference. So the learning process is simply an adjustment it makes after an initial guess. It has to tweak something inside the black box so that next time it improves its chances of getting it right. 

Optimiser: this describes how the model will be updated. As described in the minimisation of the loss it is the means by how it will do this. There are many ways of doing this which will be covered later but one is to use something called the Stochastic Gradient Descent. Stochastic means a random probability and it is used statistically to help the model learn well. 

Metrics: you also want to measure how successful your model is doing. You want to measure the accuracy. As you are training you should see the accuracy increase as the loss decreases. But once you have trained it then you need to check to see how well it really has done the job by giving it some data (images) that it hasn’t seen before and not been trained on. This will give you a first indication of exactly how well the model is performing. 

All this is a time consuming process. The first model that you use probably won’t be the last. There isn’t really one textbook that will tell what to do exactly because every problem is different and will require a different model. What you will do is experiment until your model performs well. 

One of the problems is people think that the bigger the architecture the more accurate it is going to be. The bigger the architecture and dataset the longer it will take to train and we could be talking days or even weeks. So after all that you look at your accuracy and have to tweak it slightly and then start all over again. 

What the AI can do is learn and it can do this vey well. It could just learn to identify those pictures in the dataset very, very well and have not a clue if it saw a new image. Conversely the opposite can happen where the loss never really gets very small. This is another layer of complexity which makes this fun and pulls on your understanding. Learn by having a go.