# Should the prediction of the body temperature given a camera image be modelled as classification or regression?

I am fairly new to deep learning in general and I am currently facing a problem I want to solve using neural networks and I am unsure if it is a classification or regression problem. I am aware that classification problems are about classifying whether an input belongs to class A or class B (or class C ...) and regression problems are about mapping the input to some sort of continuous output (just like the house pricing problem).

I basically want to measure the body temperature of a person using a simple video camera. To me, this seems like more of a regression type of issue rather than classification, because of the actual continuous result values I want the neural network to produce from the input video frames, e.g. 39°Celsius. But a question that came to my mind was: What if I use every integer value in the range from 35°C to 42°C as a possible output class? This would make it a classification problem, am I right? What would be the correct approach here and why? Classification or regression?

I think it depends on you application and what data you have available.

If the prediction of body temperature itself doesn't have to be accurate and classes like COLD, NORMAL, and HOT will suffice, you should stay with a classification. There isn't a cut off but as you increase the number of classes that represent numbers on the same scale, it may become more difficult to interpret the result as there will be a distribution across the classes.

If you choose regression on the other hand, you are not restricted by your classes anymore and may be able to tell the difference between 36.5 and 36C which (according to wikipedia) can be the difference between normal and cold. This is something classes may not be able to capture.

Another thing to consider is what your training data looks like and how accurately you want to predict the temperature. If you have pictures of people and a temperature reading, where was the reading taken and how accurate is the reading? If it isn't accurate (+- 1 degree) you may not be able to give as accurate predictions as you would like and may only be able to do 3 different classes like above.

If you don't have a data set, then that is another problem altogether and might require another question as it depends on your application.

I think that your problem is interesting and I hope this can help you to understand how best to apply deep learning to it.

Since you're termed the problem you're trying to solve is to "measure the body temperature of a person", the output should be a continuous valued number.

If the problem statement had been to rank or classify a person's body temperature as fever/healthy, then this could be a classification problem.

Deep learning employ neuron units at the output layer depending on the target objective.

Almost all machine learning approaches produce continuous valued predictions. The output is usually "classified" to a set of discrete labels in a separate step using cutoff values. Its best to produce a probability estimate as an outcome since the step of classifying is going to introduce additional errors due to the choice of a cutoff value.

For example, deep learning models deployed for the ImageNet computer vision dataset to classify objects into one of 1000 objects do not give the class of the object. Instead they give a 1000 value output listing the probability of that image being in a particular class. An image of a snow leopard would generate a probability of 95% snow leopard, 90% leopard, 75% Cat, etc.