Discrimination between tectonic earthquakes and quarry blasts is important for accurate earthquake cataloging and seismic hazard analysis. However, reliable classification is challenging with raw waveforms and no prior knowledge of source parameters. Here we apply deep learning to perform this task in southern California and eastern Kentucky, which differ significantly in available labelled data, class imbalance and waveform characteristics. Accordingly, we adopt different strategies for the two regions. First, we directly train a convolutional neural network (CNN) for southern California due to its data abundancy. To alleviate class imbalance, the blast data are augmented by randomly shifting waveform windows. The model for California yields an accuracy of 91.97% for single-station classification and 97.54% for network-averaged classification. Second, as eastern Kentucky has a much smaller data size, we fine-tune the pretrained California model to fit the Kentucky data. The fine-tuned model yields an accuracy of 97.35% for single-station classification and 99.46% for network-averaged classification. The fine-tuned model outperforms the model trained from scratch. Finally, we use occlusion test and gradient-weighted class activation mapping to illuminate which parts of waveforms are important for model prediction. Our results demonstrate that deep learning can achieve high accuracy in seismic event discrimination with raw waveforms and that transfer learning is effective and efficient to generalize deep learning models across different regions.