The previous article was on algorithm and hyper-parameter tuning. This article is about the general steps for building a deep learning model and also the steps to improve its accuracy along with the second type of network known as CNN.
General procedure to build an AI machine
- Obtain the data in the form of excel sheets, csv (comma separated variables) or image datasets.
- Perform some pre-processing onto the data like normalisation, binarisation etc. (apply principles of statistics)
- Split the given data into training data and testing data. Give more preference to training data since more training can give better accuracy. Standard train test split ratio is 75:25.
- Define the class for the model. Class includes the initialisation, network architecture, regularisation, activation functions, loss function, learning algorithm and prediction.
- Plot the loss function and interpret the results.
- Compute the accuracy for both training and testing data and check onto the steps to improve it.
Steps to improve the accuracy
- Increase the training and testing data. More data can increase the accuracy since the machine learns better.
- Reduce the learning rate. High learning rate often affects the loss plot and accuracy.
- Increase the number of iterations (epochs). Training for more epochs can increase the accuracy
- Hyper parameter tuning. One of the efficient methods to improve the accuracy.
- Pre-processing of data. It becomes hard for the machine to work on data with different ranges. Hence it is recommended to standardise the data within a range of 0 to 1 for easy working.
These are some of the processes used to construct a network. Only basics have been provided on the concepts and it is recommended to learn more about these concepts.
Implementation of FFN in detecting OSTEOARTHRITIS (OA)
Advancements in the detection of OA have occurred through AI. Technology has developed where machines are created to detect OA using the X-ray images from the patient. Since the input given is in the form of images, optimum performance can be obtained using CNN’s. Since the output is binary, the task is binary classification. A combination of CNN and FFN is used. CNN handles feature extraction i.e. converting the image into a form that is accepted by the FFN without changing the values. FFN is used to classify the image into two classes.
CNN-convolutional neural network
The convolutional neural network mainly works on image data. It is used for feature extraction from the image. This is a partially connected neural network. Image can be interpreted by us but not by machines. Hence they interpret images as a vector whose values represent the color intensity of the image. Every color can be expressed as a vector of 3-D known as RGB- Red Green Blue. The size of the vector is equal to the dimensions of the image.
This type of input is fed into the CNN. There are several processing done to the image before classifying it. The combination of CNN and FNN serves a purpose for image classification.
Problems are seen in using FFN for image
- We have seen earlier that the gradients are chain rule of gradient at different layers. For image data, large number of layers in order of thousands may require. It can result in millions of parameters. It is very tedious to find the gradient for the millions of these parameters.
- Using FFN for image data can often overfit the data. This may be due to the large layers and large number of parameters.
The CNN can overcome the problems seen in FFN.