Quantification of task similarity for efficient knowledge transfer in biomedical image analysis