Loss Metrics for Deep Learning (Binary Cross-Entropy vs RMSE)

Abhishek Shah
3 min readDec 9, 2022

Binary cross-entropy and root mean squared error (RMSE) are two common metrics used to evaluate the performance of machine learning models. In this article we will discuss the differences between binary cross-entropy and RMSE and when each metric should be used.

First, let’s define binary cross-entropy. Binary cross entropy is a measure of the difference between the predicted probability distribution and the true probability distribution for a binary classification problem. It is commonly used as the loss function when training a model to classify data into two classes, such as “dog” and “not dog”.

On the other hand, root mean squared error (RMSE) is a measure of the difference between the predicted values and the true values for a regression problem. It is commonly used as the loss function when training a model to make predictions on continuous data, such as predicting the price of a house based on its size and location.

One key difference between binary cross-entropy and RMSE is that binary cross-entropy is a measure of probability, while RMSE is a measure of magnitude. This means that binary cross-entropy is more sensitive to small changes in the predicted probability distribution, while RMSE is more sensitive to large errors in the predicted values.

Another difference between binary cross-entropy and RMSE is the range of possible values for each metric. Binary cross-entropy can range from 0 to infinity, with a lower value indicating a better model performance. On the other hand, RMSE can range from 0 to infinity, with a lower value also indicating a better model performance.

So, when should each metric be used? Binary cross-entropy is most commonly used when training a model for a binary classification problem, while RMSE is most commonly used when training a model for a regression problem. However, it is important to note that both metrics can be used for both classification and regression problems, depending on the specific context and the desired properties of the metric.

In conclusion, binary cross-entropy and RMSE are two commonly used metrics for evaluating the performance of machine learning models. Binary cross entropy is a measure of the difference between the predicted probability distribution and the true probability distribution, while RMSE is a measure of the difference between the predicted values and the true values. Each metric has its own strengths and weaknesses and should be chosen based on the specific problem being solved and the desired properties of the metric.

In this table, y represents the true label (0 or 1), p represents the predicted probability, and n represents the number of samples. The formula for binary cross-entropy is based on the binary cross-entropy loss function, which is commonly used for training binary classification models. The formula for RMSE is the standard formula for calculating the root mean squared error, which is a measure of the average magnitude of the errors made by the model in its predictions.

--

--

Abhishek Shah

Machine Learning Engineer @ Intel | Graduate Student MS in Artificial Intelligence and Machine learning @ University of Michigan