The joint use of multiple drugs may cause unintended drug-drug interactions (DDIs) and result in adverse consequence to the patients. Accurate identification of DDI types can not only provide hints to avoid these accidental events, but also elaborate the underlying mechanisms by how DDIs occur. Several computational methods have been proposed for multi-type DDI prediction, but room remains for improvement in prediction performance. In this study, we propose a supervised contrastive learning based method, MDDI-SCL, implemented by three-level loss functions, to predict multi-type DDIs. MDDI-SCL is mainly composed of three modules: drug feature encoder and mean squared error loss module, drug latent feature fusion and supervised contrastive loss module, multi-type DDI prediction and classification loss module. The drug feature encoder and mean squared error loss module uses self-attention mechanism and autoencoder to learn drug-level latent features. The drug latent feature fusion and supervised contrastive loss module uses multi-scale feature fusion to learn drug pair-level latent features. The prediction and classification loss module predicts DDI types of each drug pair. We evaluate MDDI-SCL on three different tasks ofΒ two datasets. Experimental results demonstrate that MDDI-SCL achieves better or comparable performance as the state-of-the-art methods. Furthermore, the effectiveness of supervised contrastive learning is validated by ablation experiment, and the feasibility of MDDI-SCL is supported by case studies. The source codes are available at https://github.com/ShenggengLin/MDDI-SCL.