The invention discloses a traffic identification and feature extraction method based on deep learning. The method comprises the steps of data packet capture, data set establishment, convolutional neural network establishment, model training, model self-study and optimization, and network data packet feature extraction. According to the method, the good performance of the convolutional neural network in data processing application is fully utilized, and the convolutional neural network which is rapid and accurate and is suitable for network message processing is designed; and flow classification prediction is carried out by utilizing the trained model, data packets with insufficient probabilities of prediction errors and classification under a correct type in a result are selected out and re-fused into a training set training model, thereby realizing autonomous optimization of the model. According to the method, a class activation mapping method is utilized to carry out feature extraction on the traffic, extracted feature fields can enable people to know the features of data packets of specific types, and the feature fields not only can be used for a traditional DPI technology, butalso are suitable for application scenarios where DPI traffic classification has been deployed.