BCE loss might help, not sure if it has the same constraint on the target.
Well, I don’t know how big are your images but the labels don’t usually take much space: it is a single number. Doing this precompute would make it contain 5numbers. A 250x250 image has almost 190 000 numbers. So these extra 4 should not change much in the size of your dataset if the feature are big enough.