Heterogeneous information networks can be used to detect whether a new transaction is fraudulent. Metapaths are determined based on the heterogeneous information. The transactions can be downsized. For each metapath, training transaction data and test transaction data be used to compute a feature vector “z.” A fraud detection system can use the features to generate a fraud detection model. The fraud detection model can be iteratively refined using machine learning. The fraud detection models can then be applied to new transactions to determine a risk score of the new transaction.