what is the loss function of pre-trained EfficientNet-B0

For validation, we trained CNN models using the pre-trained EfficientNet-B0 with 'deepNetDesigner -v1'. However, the code only shows 'Loss' without specifying which loss function is being used. If no loss function is explicitly set, which one is applied by default?

1 Comment

I believe the loss function is configured when we train the model. I assume you might have used "trainnet" function after loading the pre-trained EfficientNet-B0 model, and the function receives the Loss Function as its parameter. If you've applied a different workflow, please give us more information about that.

Sign in to comment.

Answers (1)

Hi Hyeokjun,
Since loss function is to be configured while training. I assume you have exported the code and are training the network using "trainNetwork". In this workflow, since the loss function is not specified manually it should be determined by the type of the final layer in the network.
  • If the network ends with a classification layer, it uses cross-entropy loss.
  • If the network ends with a regression layer, it uses mean squared error (MSE).
Since EfficientNet-B0 is a classification model, the loss should be cross-entropy loss.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2024a

Asked:

on 24 Mar 2025

Answered:

on 22 Aug 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!