The invention discloses a 
deep learning-based 
vulnerability detection method and 
system. The method comprises an offline 
vulnerability classifier training part and an online 
vulnerability detection part. The offline vulnerability classifier training part comprises the following steps of: calling candidate code sections for a 
training program extraction 
library / API function; adding type 
label for the candidate code sections; converting the candidate code sections into vectors; inputting the vectors into a neural 
network model to carry out training; and finally outputting a vulnerability classifier. The online 
vulnerability detection part comprises the following steps of: calling candidate code sections for a target program extraction 
library / API function; converting the candidate code sections into vectors; classifying the candidate code sections by adoption of the trained vulnerability classifier; and finally outputting the code sections which contain online vulnerabilities in the 
classification result. According to the method and 
system, vulnerability features aiming at 
library / API function calling can be automatically generated, and the operation does not depend on expert knowledges and is not restricted to vulnerability types, so that the false report rate and missing report rate of 
vulnerability detection in target programs can be remarkably reduced and vulnerability positions can be given.