This paper introduces a complete heartbeat classification system based on modified stacked denoising autoencoders and neural networks. This system includes three parts and they are preprocessing, feature extraction, and classification. In the preprocessing part, the original ECG signal is filtered and segmented as each single heartbeat. In the feature extraction part, the features are extracted from the original heartbeat signal by using modified stacked denoising autoencoders. In the classification part, the neural networks are selected to classify the heartbeats, and achieves the accuracy of 97.99% on 16 classes of arrhythmic events. The proposed method not only achieves the high accuracy on heartbeats classification, but also gets rid of the works on feature designing compared with other similar methods.