Could you explain a bit how you are feeding the target to the network?
Usually you would feed the data into the model and use its output and target to calculate the loss.
You don’t need to apply a threshold on the target to calculate the loss.
However you might want to apply a threshold on the model outputs to get the class predictions (for a binary use case).