[Summary] How to choose an appropriate loss function in industrial inspection projects

1. From the perspective of error: MSE (L2 loss) can be used to evaluate the degree of data change, and MAE (L1 loss) can better reflect the actual situation of the error of the predicted value.

2. From the point of view of outliers: if the outliers are just damage during data extraction or wrong sampling in data cleaning, then we don’t need to pay too much attention, then we should choose MAE, but if the outliers are The actual data or important data need to be detected outliers, then we should choose MSE.

3. From the perspective of convergence speed: MSE>Huber>MAE.

4. In terms of the complexity of solving the gradient: MSE is better than MAE, and the gradient is also dynamically changing, so MSE can achieve convergence quickly and accurately.

5. From the perspective of model selection: For most CNN networks, we generally use MSE instead of MAE, because training CNN networks attaches great importance to training speed. For the border prediction regression problem, you can usually choose the square loss function, but the square The disadvantage of the loss function is that when there are outliers, these points will account for the main part of the loss. For target detection Faster RCNN uses a slightly milder absolute loss function (smooth L1 loss), which grows linearly with the error instead of quadratically.

Guess you like

Origin blog.csdn.net/Mike_honor/article/details/125807862