Transfer Learning Question

If we use a pretrained model for a different task, are the hidden layers labeled somehow like this … “detects edges” etc? How do we know what each hidden layer does when we’re looking at the code?

No, in practice, we really don’t know what each layer detects. And we don’t really care. The model’s performance is what matters (and is the only thing we can measure in any case).