Search code examples
machine-learningkerasresnet

Use resnet50 for regression - keras


I'm playing around with teaching a car to drive itself in a video game. I'm approaching it as a regression problem with an output for the steering value between -1 and 1.

After doing some research it looks like the resnet50 model may be a good place to start... But reading the keras documentation it shows specifying the number of classes.

Can it be used for regression?

Or should I approach it as a classification problem and break up the steering range into several class?


Solution

  • You can use it for regression, the detection models like Faster R-CNN, SSD, YOLO use regression for the bounding box prediction part. For such case you would typically replace cross entropy loss with mean squared loss. If the range for your output values don't differ too much, you can also use a classification approach. If the number of classes don't end up being too large, this might actually perform better.