Characterization of tumor heterogeneity through segmentation-free representation learning