Avoiding trivial solution with sparse output
Some interesting suggestions I got from others: 


split the network so that each subnetwork is in charge of a subset of the classes.
use the Dice loss or jaccard loss which are pretty good for this situation.
pre-train with the less prevalent classes only and add classes over epochs. This needs to be done very carefully.