8 Regression ClassificationObject Detection
A convolutional neural network (CNN) is often used for image classification. Generally speaking, classification refers to the task of using data and known responses to build a predictive model that predicts a discrete response for new data. For image classification, the input data is the image and the known response is the label of the image subject. On the other hand, regression is another task that can be accomplished with deep learning. Regression refers to assigning continuous response values to data, instead of discrete classes. One example of image regression is correcting rotated images. The input data is a rotated image, and the known response is the angle of rotation.
Preparing Data for Regression
To perform transfer learning for regression, we can use the trainNetwork function with the data, architecture, and training options as input.
Modification of CNN Architecture from Classification to Regression
Let us load AlexNet and save the network layers in a variable named layers.
>>net = ...
Get Machine and Deep Learning Using MATLAB now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.