Our study indicates that AI applied on hepatocellular carcinoma digital slides is able to serve as a biomarker for progression-free survival in patients treated with atezolizumab–bevacizumab. This approach could be used in the development of inexpensive and fast biomarkers for targeted therapies. The combination of AI heatmaps with spatial transcriptomics provides insight on the molecular features associated with predictions. This methodology could be applied to other cancers or diseases and improve understanding of the biological mechanisms that drive responses to treatments.