Prematureventricularcontraction(PVC)isatypeof prematureectopicbeatoriginatingfromtheventricles. Automatic method for accurate and robust detection of PVC ishighly clinically desired.Currently, most of these methods are developed andtested using the same database divided into training and testing set and theirgeneralization performance across databases has not been fully validated. Inthis paper, a method based on densely connected convolutional neural networkand spatial pyramid pooling is proposed for PVC detection which can takearbitrarily-sized QRS complexes as input both in training and testing. With amuch less complicated and more straightforward architecture,the proposednetwork achieves comparable results to current state-of-the-art deep learningbased method with regard to accuracy,sensitivity and specificity by trainingand testing using the MIT-BIH arrhythmia database as benchmark.Besides thebenchmark database,QRS complexes are extracted from four more open databasesnamely the St-Petersburg Institute of Cardiological Technics 12-lead ArrhythmiaDatabase,The MIT-BIH Normal Sinus Rhythm Database,The MIT-BIH Long TermDatabase and European ST-T Database. The extracted QRS complexes are differentin length and sampling rate among the five databases.Cross-database trainingand testing is also experimented.The performance of the network shows animprovement on the benchmark database according to the result demonstrating theadvantage of using multiple databases for training over using only a singledatabase.The network also achieves satisfactory scores on the other fourdatabases showing good generalization capability.